Labels not updating, how do I fix it?
I've created a script that will auto update the labels of a GUI. I've tried both Script and LocalScript, yet nothing is working for me. There are no errors whatsoever, which makes me think that the script isn't even running at all.
Here is my code if you need it:
017 | { Song = script.Day, Weather = 0 , TimeOfDay = { "Dawn" , "Noon" } } , |
018 | { Song = script.Sunset, Weather = 0 , TimeOfDay = { "Dusk" } } , |
019 | { Song = script.Night, Weather = 0 , TimeOfDay = { "Night" } } , |
022 | { Song = script.MorningRain, Weather = 1 , TimeOfDay = { "Dawn" } } , |
023 | { Song = script.Rain, Weather = 1 , TimeOfDay = { "Noon" , "Evening" } } , |
024 | { Song = script.NightRain, Weather = 1 , TimeOfDay = { "Night" } } , |
027 | { Song = script.Thunderstorm, Weather = 2 , TimeOfDay = { "Dawn" , "Noon" , "Dusk" , "Night" } } |
058 | game:GetService( "RunService" ).Heartbeat:Wait() |
062 | local RS = game:GetService( "RunService" ) |
064 | local dayLabel = script.Parent.Day |
065 | local timeOfDayLabel = script.Parent.TimeOfDay |
067 | local music = script.Parent.Music |
069 | RS.Stepped:connect( function () |
070 | local timeOfDay = "Night" |
071 | local weatherString = "" |
073 | if (game.Lighting.ClockTime > - 1 ) and (game.Lighting.ClockTime < 6 ) then |
075 | elseif (game.Lighting.ClockTime < 12 ) then |
077 | elseif (game.Lighting.ClockTime < 18 ) then |
079 | elseif (game.Lighting.ClockTime < 24 ) then |
083 | if game.Lighting.Weather.Value = = 1 then |
084 | weatherString = " (Rain)" |
085 | elseif game.Lighting.Weather.Value = = 2 then |
086 | weatherString = " (Thunder)" |
089 | dayLabel = "Day " ..game.Lighting.Day.Value |
090 | timeOfDayLabel = timeOfDay..weatherString |
092 | for _,i in pairs (songs) do |
093 | if (i.Weather = = game.Lighting.Weather.Value) then |
095 | for _,v in pairs (i.TimeOfDay) do |
096 | if v = = game.Lighting.TimeOfDay.Value then |
098 | music.SoundId = i.Song.SoundId |
101 | if found = = true then break end |
105 | if music.IsPlaying = = false then |
Thanks!