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

Flashing light depending on time??

Asked by
Uroxus 350 Moderation Voter
9 years ago

I've got a light and a day / night script but I want the light to only come on and start flashing at certain times and stop at a certain time...

Here is part of my day / night script (Not sure if its needed to fix my problem)

while true do
game.Lighting.TimeOfDay = "12:00:00"
wait(60)
game.Lighting.TimeOfDay = "13:00:00"
wait(60)
game.Lighting.TimeOfDay = "14:00:00"
wait(60)
game.Lighting.TimeOfDay = "15:00:00"
wait(60)
game.Lighting.TimeOfDay = "16:00:00"
wait(60)
game.Lighting.TimeOfDay = "17:00:00"
game.Lighting. Ambient = Color3.new(95 / 255, 95 / 255, 95 / 255)

And it keeps going till it reaches a full cycle and then re-starts... This works fine, Its just my flashing light that dosent work. Heres my script:

while true do
    wait (60)
    if game.Lighting.TimeOfDay >= "17:30:00" then
        repeat script.Parent.PointLight.Enabled = true
            wait (2)
            script.Parent.PointLight.Enabled = false

        until game.Lighting.TimeOfDay >= "08:30:00"
        script.Parent.PointLight.Enabled = false

    end
end

Its located in Workspace - Ship - Light and also in the part of 'Light' is the PointLight but it dosent pulse on and off with 2 second delay until the time of 08:30:00 is reached, it's always on... If anyone could help, I would be very thankful...

Thanks in advance =)

1 answer

Log in to vote
0
Answered by 9 years ago

You never make game.Lighting.TimeOfDay >= "17:30:00" true. It goes to "17:00:00" then goes back to 12:00:00. It's always on because you never trigger the if loop and by default it is on.

0
Hope it helps dudemanloserr 15 — 9y
0
Nope, I've eddited the script to include 17:30:00 and 08:30:00 and it dosent make any difference. Thanks for trying though Uroxus 350 — 9y
Ad

Answer this question