Im trying to make a sound play when the ingame time hits 6.
local Time = game.Lighting.ClockTime local Chime = script.Parent.Sound game.Lighting.Changed:Connect(function(property) if property == "ClockTime" then if Time == 6 then Chime:Play() end end end)
This is what I've got right now!
Add a print('hit 6') after if time == 6.
Your problem might be that it skips over 6 because of how precise that is. You could instead do this:
game.Lighting:GetPropertyChangedSignal("Time"):Connect(function() if game.Lighting.Time >= 5.9 and game.Lighting.Time <= 6.1 then Chime:Play() end end)
*fixed