So I need my script to continuously check if a certain bool value changed but I don't know how. Anyone here who knows how to do this?
I tried to put it in my loop like this but that didn't work:
while game.ReplicatedStorage.RoundSystemValues.VoteStarted.Value == true do
You can either use the instance.Changed event or put the check inside a while wait() do loop.
this is the instance.Changed() event version
game.ReplicatedStorage.RoundSystemValues.VoteStarted.Changed:Connect(function() if game.ReplicatedStorage.RoundSystemValues.VoteStarted.Value = true then --insert what you want to happen here else end end)
this is the while wait() do loop
while wait() do if game.ReplicatedStorage.RoundSystemValues.VoteStarted.Value = true then --insert what you want to happen here else end end
Note: i use a while wait() do loop instead of a while true do loop to avoid script exhaustion.