Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a code run only WHILE a bool value is on true?

So if the bool value turns off again the code will not execute.

4 comments

0

while bool == true do

0

if bool == true do print('running') else print('not running') end

0

OMG U ARE A LEGEND Y DIDNT I THINK OF THAT

0

Lol, its as simple as that

1 answer

It's pretty simple. You would just use Bool value = true/ false. When it's executed, use the IF statement.

if Example.Value then
     -- Fire whatever you have. I wouldn't recommend using while true do though.
end

This discussion is preserved as it was. New answers, comments, and votes are closed.