ClockTime won't change

the part doesnt even show up when in Lighting

My bad, the script is actually in the part.

I mixed up another script with it, I’m kind of dumb lol

As EmbatTheHybrid mentioned, was the ClockTime already 14 before the you touched the part?

Is the script a LocalSCript or a regular script?

1 Like

Nope, ClockTime never changed.

The script is a LocalScript.

303030

LocalScripts do not work in workspace, use a regular script or put it i nStarterPlayerScripts and change it around

2 Likes

The LocalScript is inside the part that is being touch detected.

Or just make it a regular script, if you want all players to see

That doesn’t matter the script is still a descendant of the workspace it will not run.

That’s why it doesn’t work, Localscripts do not work there, are you trying to make it change for all players or a specific player?

1 Like

Maybe you have other Script that changes ClockTime, for example Night / Day Script. If yes, then your second Script will most likely not work (actually depends on how is it Scripted).

The player who touches the part will have only their clocktime changed.

Nope, I don’t use a day/night script.

Put the localscript in StarterPlayerScripts and change it to this

local sethours = 14
local lighting = game:GetService("Lighting")

local plr = game:GetService("Players").LocalPlayer

local part = --Location of your part

part.Touched:Connect(function(hit)
	if not plr.Character or not hit:IsDescendantOf(plr.Character) then return end
	lighting.ClockTime = sethours
end)
2 Likes

Oh, also I forgot to mention, there’s another LocalScript inside StarterPlayerScripts and it also changes the ClockTime when a RemoteEvent gets triggered.

Let me see if that works too, if it doesn’t there may be a problem.

If it is supposed to also change it to the same time, simply fire that event from the part

That shouldn’t be an issue, it wont collide with your touched script, so the other localscript shouldn’t be an issue. Remember that you have to add the location of your part in the local part = variable or else an error will occur

The time is set to 0 when you play. (in my game)

1 Like