Discuss Scratch

craftingdickson
Scratcher
84 posts

Emergency help

Hi guys, i made a script:
when I receive [ v]
forever

if <(turn) = [1 ]> then
computer turn
if <<(x position) = (x)> and <(y position) = (y) >> then

switch costume to [x v]
end
set [turn v] to [0 ]
end

end
define computer turn
repeat until <(item ((number) v) of [Grid v]) = [ ]>

set [number v] to [ (pick random (1) to (9)]

end
replace item ((number) v) of [Grid v] with [x ]
reverse find
define reverse find
if <(number) = [ 1]> then

set [x v] to [ -64]
set [y v] to [ 64]
end
if <(number) = [ 2]> then

set [x v] to [ 0]
set [y v] to [ 64]
end
...
When the script goes to if x position=x and y position=y, the clone(the sprite has clones) won't switch costume to x for no reason, why? Can somebody help me fix this?
lederniersamourai
Scratcher
500+ posts

Emergency help

It seems that the master enters in the first “computer turn”, gets its turn, then puts the “turn” varible to 0
Then after that, the clones cannot enter in the “if computer turn” because the “turn” is set to 0

Powered by DjangoBB