#lighting.Clocktime not updating in roblox studio

1 messages · Page 1 of 1 (latest)

dim hawk
#

So i currently got this script
local Lightobj = script.Parent
local Light = script.Parent.SpotLight
local lighting = game:GetService("Lighting")

while true do
task.wait(5)
local currentHour = lighting.ClockTime
print(currentHour)

if currentHour > 6.25 and currentHour < 17.75 then
    Lightobj.Color = Color3.new(0, 0, 0)
    Light.Enabled = false
else
    Lightobj.Color = Color3.new(1, 1, 1)
    Light.Enabled = true
end

end

#

what its doing is that its turnign on a light and turning it off at certain times

#

and also printing the currenttime every 5 seconds