Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED]Why are the lamps are not turning on at night when the time reaches 0?

Asked by 5 years ago
Edited 5 years ago

I am trying to make a script that turns a lamp on when the time is past 19:00:00. It works fine till 23:00:00 but then the time reaches 0 so then the lights are turned off even though it is still night. Can you tell me how can I possible fix this?

local lights = script.Parent.Bulb:GetChildren()
local lighting = game.Lighting

while true do
    wait(0.5)
    if lighting.ClockTime < 19 then
        for i,v in ipairs(lights) do
            v.Range = 0
        end
    elseif lighting.ClockTime > 19 then
        for i,v in ipairs(lights) do
            v.Range = 60
        end
    end
end
0
use :GetMinutesAfterMidnight() User#24403 69 — 5y
0
I don't know how StrategicPlayZ 58 — 5y
0
bcz u have to do => or >= pretty sure tacotown2 119 — 5y

Answer this question