For x = 101 to 120
If Npcmove = 300
Dire = Rnd(4)
If Dire = 1 then point object x, Object position x(x) + 100, object position y(x), Object position z(x)
If Dire = 2 then point object x, Object position x(x), object position y(x), Object position z(x) + 100
If Dire = 3 then point object x, Object position x(x) - 100, object position y(x), Object position z(x)
If Dire = 4 then point object x, Object position x(x), object position y(x), Object position z(x) - 100
Endif
Move object x,0.2
Next x
Inc Npcmove
When i use that code, the npc walks along in the same direction at the start each time, then goes a random direction but carries on in the same direction after that instead of changing each time npcmove = 300
P.S that code snippet is in my main loop