Time wont change

So, basically I want it so that, when you type “Night” or “Day” etc I want the in-game time to change.

Now, I tried doing this locally, and the script worked, then I used remote events and it all went to mess.

Here is the local script located in StarterGUI

Explorer

image

Script
local GWCFolder = game.ReplicatedStorage.GWCEvents

local LightingEvent = GWCFolder.Lighting

local GUI = script.Parent.Time.Frame.Confirm
local NotSpecific = game.Players.LocalPlayer.PlayerGui.Menu.Menu.Time.Frame.ObjectiveTime

GUI.MouseButton1Click:Connect(function(yeet)
	
	print("Server, do you copy?")
	game.ReplicatedStorage.GWCEvents.Lighting:FireServer()
	
end)

Here is the script located in SSS.

Script
local GWCFolder = game.ReplicatedStorage.GWCEvents

local LightingEvent = GWCFolder.Lighting

local Lighting  = game:GetService("Lighting")
local Clocktime = Lighting.ClockTime

local NotSpecific = game.Players.LocalPlayer.PlayerGui.Menu.Menu.Time.Frame.ObjectiveTime

 		


LightingEvent.OnServerEvent:Connect(function(player, NotSpecific)
	
	print("This is server, we copy")
	
	if NotSpecific.Text == "Night" then

		game.Lighting.ClockTime = 21

	elseif NotSpecific.Text == "Evening" then

		game.Lighting.ClockTime = 18

	elseif NotSpecific.Text == "Afternoon" then

		game.Lighting.ClockTime = 17

	elseif NotSpecific.Text == "Day" then

		game.Lighting.ClockTime = 12

	elseif NotSpecific.Text == "Morning" then

		game.Lighting.ClockTime = 7


	end
	
	
end)

Sorry for the double post, any help would be apreciated as always

1 Like

Why are you indexing LocalPlayer on the server? This doesn’t exist on the server. If you want it to only show up for the client, you should keep it like you did, if you use remotes you would be trying to make it show up for everyone in the game which I’m not sure is if that is what you’re trying to do here…

I want it so that everyone can see the time change