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 10 years ago

For some reason the repeat works once.

1while true do
2    wait ()
3    if ismove == false then --"ismove" is a Tool.Enabled setting
4    StartUp()
5    end
6end
0
Did you turn Enabled true again? EzraNehemiah_TF2 3552 — 10y

2 answers

Log in to vote
-3
Answered by 10 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 — 10y
0
Just a note to what you said: I could do wait () if I wanted...the space does not matter BSIncorporated 640 — 10y
Ad
Log in to vote
1
Answered by 10 years ago

you could do

1while not ismove do -- will check if ismove = false
2    wait ()
3 StartUp()
4end

Answer this question