So im having another scripting issue... I have two songs that i would like to be played but at different times, one at 6am and the other at 6pm and this method works fine until it reaches 6pm again. Not sure what im doing wrong on this..
local Song = game.Workspace.PalletTown1.Dakota
local Song1 = game.Workspace.PalletTown1.Dakota1
while true do
wait(.1)
if game.Lighting.TimeOfDay == "06:00:00"
then
Song1:Stop ()
wait(.1)
Song:Play()
Song.Looped = true
print("Day Song is playing")
end
if game.Lighting.TimeOfDay == "18:00:00"
then
Song:Stop ()
wait(0.1)
Song1: Play()
Song1.Looped = true
print("Night Song is playing")
end
end

7 comments
wouldnt this create a new Day/Night Cycle? If so i already have on in a separate script. I wouldnt be able to combine them like this bec my game will have separate area in the game.
Are you able to just use this script? Or not?
You have to be able to explain the script for him to understand it.
To prevent it from making a new day/night cycle, just remove the first 3 lines under the 'while true do'.
probably not bec when my players go to a different area it will have a different music for that area. Which is why i had my day cycle code in another script, if i did it this way it would make 2 day cycles and cause an error. Basically what im focusing on is if your in this town it will start off in the day song then once night hit i would want the night time song to play, but i wouldnt want thi
Just remove the 3 lines of code underneath the 'while true do'.
this song for another town or a route bec then it would be too plain. Thats why i had the TimeOfDay function instead of SetMinutesAfterMidnight