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?
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)
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)
what does your current script look like? and where is its location? and what type is it?
Alright, it worked by putting it in StarterPlayerScripts.