i got 2 text boxes, one for hours and one for minutes
how can i make it so the in game minutes is the same as the textbox for minutes text and in game hours is the same as the textbox for hours? local script:
script.Parent.MouseButton1Click:Connect(function() local hour = tonumber(script.Parent.Parent.hour.Text) local minute = tonumber(script.Parent.Parent.minutes.Text) game.ReplicatedStorage["control time"]:FireServer(hour,minute) end)
server script:
local minutes = 60 * 12 game.ReplicatedStorage["control time"].OnServerEvent:Connect(function(plr,hour,minute) minutes = minute * hour end) while true do game.Lighting:SetMinutesAfterMidnight(minutes) minutes = minutes + 1 print(minutes) if game.Lighting.ClockTime == 12 then game.ServerStorage.day.Parent = game.Lighting game.Lighting.night.Parent = game.ServerStorage end if game.Lighting.ClockTime == 18 then game.Lighting.day.Parent = game.ServerStorage game.ServerStorage.night.Parent = game.Lighting end wait(1.5) end
If you create/change something in the server with a local script, it only changes that thing on the player's computer. So if you change the ControlTime to something with LocalScript, a server script will not see it. Try to make it with module script functions, here's a link if you don't know how