of     1   

RoQuick
#184286152Thursday, February 25, 2016 4:06 AM GMT

while test.Value == true do for i = 30,0,-1 do text.Text = i wait(1) end end i want the for function to work but only if the test.value is true and make it stop when its false please help
RoQuick
#184286192Thursday, February 25, 2016 4:06 AM GMT

sorry I should have said more this script works but if the test.Value turns to false, the countdown will still continue
Contrary
#184286437Thursday, February 25, 2016 4:11 AM GMT

Well, the issue comes from the fact that the loop will execute if the value is "true", and it'll keep running what's inside until it's over. In this case, you have a for-loop... so that will have to finish before it checks if the value is "true" again. Try something like: for i = 30,0,-1 do if test.Value == true then text.Text = i end wait(1) end end
malachi11
#184286460Thursday, February 25, 2016 4:11 AM GMT

A while loop only checks if it is still true after the loop is finished. In this case, after the countdown is done. You could do something like this: while test.Value == true do for i = 30,0,-1 do if (test.Value~=true) then break --This will immediately cancel the for loop, then the script will go back to the while loop and end that too. end text.Text = i wait(1) end end
RoQuick
#184286690Thursday, February 25, 2016 4:16 AM GMT

thank u guys

    of     1