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

How do I make a script constantly check a bool value, and if its true/false it does something?

Asked by
A_Mp5 222 Moderation Voter
3 years ago

How do I make a script constantly check a bool value, and if its true/false it does something, without useing a while true do if bla bla.

0
why not use a while true do MarcTheRubixQb 153 — 3y
0
its the best way to do it MarcTheRubixQb 153 — 3y
0
Infinite loops should be avoided MacaylaMarvelous81 15 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago
Edited by Ziffixture 3 years ago
BoolValue:PropertyChangedSignal("Value"):Connect(function()
    if BoolValue.Value == true then
        -- Do stuff here
    end
end)
Ad

Answer this question