I need night/day change script that changes background music zones! Place: https://www.roblox.com/games/1452770622/Bee-Swarm-Showcase
If you have a time of day script already implemented, then that's all you really need.
Insert another script into "ServerScriptService" or something like that in the explorer. Then the script would be something like this
TofD = game.Lighting.TimeOfDay -- variables Sound1 = game.Workspace.Sound Sound2 = game.Workspace.Sound2 -- You can change sound name in workspace, so it doesn't get cluttered if TofD == 0 then Sound1:Play() if TofD == 5 then Sound1:Stop() Sound2:Play() end end
This is just AN EXAMPLE, since I don't know how you want the code to be. I wouldn't copy the code. I hope this helps in someway as a reference to what you needed.
Hello, You can do this by simply adding a GetPropertyChangedSignal event to Lighting and checking the ClockTime.
game.Lighting:GetPropertyChangedSignal("ClockTime"):Connect(function() local Time = game.Lighting.ClockTime if Time >= 18 or Time <= 6 then print("It's night.") -- Your Code Here else print("It's day.") -- Your Code Here end end)
Each time ClockTime is changed, we'll check if the time is greater or equal than 18 or less or equal than 6. If it is true, it's night, if not, it's day.
Closed as Not Constructive by JakyeRU, ForeverBrown, and hiimgoodpack
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?