I want to make the loop wait for the value to be less than or equal to zero.
I’ve tried return, but it does not work. If the value is less than zero before the 7.3 wait is over, the script works.
Any help would be appreciated greatly.
I also must keep this in the loop, as this is an automatic breach system.
wait(7.3)
script.Parent.Sound.Playing = false
script.Parent.Sound.Looped = false
if tracker.Infected.Value <= 0 then
Close1:Play()
Close2:Play()
local debounce = false
tracker.Infected:GetPropertyChangedSignal("Value"):Connect(function()
if not debounce and tracker.Infected.Value <= 0 then
-- code here
end
end)
wait(7.3)
debounce = true