local lighting = game:GetService("Lighting")
local sound1 = script:WaitForChild("Sound1")
local sound2 = script:WaitForChild("Sound2")
sound1.Looped = true
sound2.Looped = false
sound1:Play()
local function onTimeChanged()
if lighting.ClockTime == 20 then
sound1:Stop()
wait(580)
sound2:Play()
elseif lighting.ClockTime == 6 then
sound2:Stop()
wait(.1)
sound1:Play()
end
end
lighting:GetPropertyChangedSignal("ClockTime"):Connect(onTimeChanged)
I want the music to stop at 20:00:00, but start again at 6:00:00. So I did the math (60 * 4 = 240, 240 * 2 = 580. I did this because the time changes by one minute every two seconds.) but the problem is that the music doesn't even stop at 20:00:00.

1 comment
il try to figure it out