Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is "while true do" making my script not work properly?

Asked by
zGavinz 11
3 years ago

For some reason, my script does not work properly with while true do.

    z_stage.Value = true
    wait(math.random(30, 45))
    moving.Value = true
    z_stage.Value = false
    if math.random(1,10) == 1 then
        z_room2.Value = true
else z_room.Value = true
    end

^ Everything works

while true do
    z_stage.Value = true
    wait(math.random(30, 45))
    moving.Value = true
    z_stage.Value = false
    if math.random(1,10) == 1 then
        z_room2.Value = true
else z_room.Value = true
    end
    end

^ "z_stage.Value = false" does not run

Does anybody have any ideas why this does not work?

Answer this question