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

My script is not working even though there are no errors. Any help?

Asked by
pevdn 32
4 years ago

The lighting properties are set to 11:59:57 but this script is not working. HELP!! here is the script-



if game.Lighting.TimeOfDay == "12:00:00" then script.Parent.Transparency = 0.5 wait(0.2) Transparency = 0.5 wait(5) script.Parent.CanCollide = false wait(0.2) CanCollide = false if CanCollide == false then print("CanCollide has been set to false.") end if Transparency == 0.5 then print("The baseplate is now transparent.") end end

1 answer

Log in to vote
0
Answered by 4 years ago

You said the lighting properties are set to 11:59:57. That if statement only runs once. Even if the time changes in game, it won’t fire since it only checks one at the start of the game. You should check when it changes using Instance:GetPropertyChangedSignal().

Ad

Answer this question