don’t really wanna share my script in case its bad but I just need help with this
local lighting = script.Parent
local function updateTimeOfDay()
local timeOfDay = lighting:GetAttribute("TimeOfDay")
if timeOfDay == 20 then
lighting.Brightness = 0
elseif timeOfDay == 5 then
lighting.Brightness = 3
end
end
lighting:GetPropertyChangedSignal("TimeOfDay"):Connect(updateTimeOfDay)
TimeOfDay returns a string not a number, use ClockTime instead cause it returns a number unlike timeofday
local lighting = script.Parent
local function updateTimeOfDay()
local timeOfDay = lighting.ClockTime
if timeOfDay >= 20 then
lighting.Brightness = 0
elseif timeOfDay < 20 then
lighting.Brightness = 3
end
end
lighting:GetPropertyChangedSignal("ClockTime"):Connect(updateTimeOfDay)
make a localscript inside startercharacterscripts and put the code in there, also make sure to redefine lighting, it should work I dont see why it wouldn’t, if it still doesnt let me know ill get on studio to make it really quick