I'm trying to make a randomly generating item generator. that will make another item at that location that will repeat the same code but with different variables etc. let's say that the object before it picked 3 (down) So what it would do is R1X= 3 //from before when the object before picked the down R2E= pick a random direction(1,4) if the number is not the same as the exit of the generator before it then does the following. if it's not then repeat if direction = 1 make object at x+448 if direction =2 make object at y+448 if direction = 3 make object at x-448 if direction = 4 make object at y-448 Then after running through the generator it will get the R1X and the R2E and add them to a bigger string. for example R1X=4 It picks 4 as the R2E As they are the same it repeats the code Picks again and gets 2 as the R2E. generates object at Y+448 Then gets Numbers 4 and 2 and adds them to the beginning of a string 42110101110110101011010101101010101110 so 42//Both combined\\ +string98(13131...). Iv been trying to write a code but I just can't get my head around all the strings and everything also all the r1x r81e R21x etc all have to be global so the other objects can use them. and all the numbers iv said will be changed. Its really bugging me Hope you can help even in any part of the code.