01 | local crickets = game.Workspace:WaitForChild( "Crickets" ) |
02 | local Time = game.Lighting.ClockTime |
03 |
04 | game.Lighting:GetPropertyChangedSignal( "ClockTime" ):Connect( function () |
05 | if Time = = 18 then |
06 | crickets:Play() |
07 | elseif Time = = 6 then |
08 | crickets:Stop() |
09 | end |
10 | end ) |
I don't get any errors, but the sound isn't playing at all. I tried it with a script aswell, but still doesn't work.
You are checking wrong, you should check what property was changed:
01 | local crickets = game.Workspace:WaitForChild( "Crickets" ) |
02 | local Time = game.Lighting.ClockTime |
03 |
04 | game.Lighting.Changed:Connect( function (property) -- //Use .Changed and in (property) |
05 | if property = = "ClockTime" then -- //Checks if changed property was "ClockTime" |
06 | if Time = = 18 then |
07 | crickets:Play() |
08 | elseif Time = = 6 then |
09 | crickets:Stop() |
10 | end |
11 | end |
12 | end ) |