if game.Workspace.Clock.Value == 3 then script.Parent.Image = "http://www.roblox.com/asset/?id=166903827" game.Lighting.NightScript:clone().Parent = script.Parent.Parent.NightTime script.Parent.Parent.NightTime.BackgroundColor3 = script.Parent.Parent.DayTime.BackgroundColor3 end
Why won't this work?
Remember: If statements only run once.
I may be wrong, but if your goal is to do that code whenever Clock's value == 3, then it will not work. If statements only run once. If Clock's value is not three the first time the if statement runs, even if it equals 3 later, your code will not execute. To fix this, use the Changed event.
game.Workspace.Clock.Changed:connect(function() if game.Workspace.Clock.Value == 3 then script.Parent.Image = "http://www.roblox.com/asset/?id=166903827" game.Lighting.NightScript:clone().Parent = script.Parent.Parent.NightTime script.Parent.Parent.NightTime.BackgroundColor3 = script.Parent.Parent.DayTime.BackgroundColor3 end end)
Other than that, I don't know. Like Tesouro said, make sure all your paths are correct, and include any output.