So I made a Gui where if you click a button the time will be set to 8 pm. Since this is a localscript put into the Gui, I'm going to need a remote event. So I put it in ReplicatedStorage and put the script in ServerScriptService.
Here's the code for the localscript:
local button= game.StarterGui.ScreenGui.TextButton
local minutesaftermidnight= (20 * 60)
button.MouseButton1Down:Connect(function()
game.ReplicatedStorage.LightingReplicator:FireServer(minutesaftermidnight)
end)
Here's the code for the Server Script:
game.ReplicatedStorage.LightingReplicator.OnServerEvent:Connect(function(player,timegiven)
game.Lighting:SetMinutesAfterMidnight(timegiven)
end)
I've been adjusting things and it still won't work, and the output won't show any errors. Why does this happen?

2 comments
Right, thank you for the answer.
You're welcome :3