Hello, I am scripting a schedule system that changes a GUI when the schedule changes. I was wondering how to get this code past the client boundry and make it serverwide because when I change the client to the server it still says “Lights Out 12:00:00” which I can’t seem to fix
local lockdown = script.Parent.Parent.lockdown.Value
Period = game.StarterGui.ScreenGui.Frame.Period.Text
game:GetService('Lighting'):GetPropertyChangedSignal('ClockTime'):Connect(function()
local CurrentTime = game.Lighting.ClockTime
if CurrentTime == 7 and lockdown == false then
Period = "Mealtime"
game.Workspace.Music.Night:Stop()
game.Workspace.Music.Meal:Play()
elseif CurrentTime == 9 and lockdown == false then
Period = "Yardtime"
game.Workspace.Music.Meal:Stop()
game.Workspace.Music.Freetime:Play()
elseif CurrentTime == 12 and lockdown == false then
Period = "Mealtime"
game.Workspace.Music.Meal:Play()
game.Workspace.Music.Freetime:Stop()
elseif CurrentTime == 14 and lockdown == false then
Period = "Freetime"
game.Workspace.Music.Meal:Stop()
game.Workspace.Music.Freetime:Play()
elseif CurrentTime == 18 and lockdown == false then
Period = "Mealtime"
game.Workspace.Music.Meal:Play()
game.Workspace.Music.Freetime:Stop()
elseif CurrentTime == 20 and lockdown == false then
game.Workspace.Music.Meal:Stop()
game.Workspace.Music.Cells:Play()
Period = "Celltime"
elseif CurrentTime == 21 and lockdown == false then
Period = "Lights Out"
game.Workspace.Music.Cells:Stop()
game.Workspace.Music.Night:Play()
end
end)
this is what the schedule GUI looks like
The time also changes to Lights Out permanently no matter the time of day when you die