I am trying to do a script where if the boolvalue is true then it would loop the flashing lights on and off constantly but when the boolvalue goes false it turns the lights off completely. Can anyone help me with this regard?
local function LoopBool()
while BoolValue.Value do
-- Do whatever here
end
end
BoolValue.Changed:Connect(function()
if BoolValue.Value then
LoopBool()
end)
Essentially when the Boolean value is false it breaks out of the loop, although the condition for the AlarmTriggered has to be false in order to do that. Though you haven’t told us when you want that condition to be met.