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

while true do wont repeat?

Asked by 9 years ago

For some reason the repeat works once.

while true do
    wait ()
    if ismove == false then --"ismove" is a Tool.Enabled setting
    StartUp()
    end
end
0
Did you turn Enabled true again? EzraNehemiah_TF2 3552 — 9y

2 answers

Log in to vote
-3
Answered by 9 years ago

Your loop won't repeat, as you're checking for a variable, and then activating a function. Just as the loop name implies, "while TRUE do" will only check for a true, but once it gets a false, it'll break itself to avoid unnecessary memory usage.

If you want it to work, then change the "while true do" to something like "while wait() do", and then remove the second wait.

Another error you have is that the wait() method MUSt have its parenthesis attached to it (without any spaces), not like you did in your script.

Hope this helps!

TheArmoredReaper

0
But the word 'true' will never equal false -- therefore the loop will run eternally. Probably something in the function is incorrect or the variable is set wrong. Perci1 4988 — 9y
0
Just a note to what you said: I could do wait () if I wanted...the space does not matter BSIncorporated 640 — 9y
Ad
Log in to vote
1
Answered by 9 years ago

you could do

while not ismove do -- will check if ismove = false 
    wait ()
 StartUp()
end

Answer this question