Script has no error but isn't running at all, nothing even shows in Script Performance??
Asked by
8 years ago Edited 8 years ago
Following the Day/Night cycle tutorial, I decided to separate the statements that operate the Lamps from turning on and off depending on the day and the statements that cycles through Day and Night.
When I did that, the script doesn't work at all but it shows no error, there is nothing inside Script Performance either so I know it's not running.
The script is inside a part called "Lightpart" along with another child called "PointLight" which is a PointLight. The parent of Lightpart is a Model.
Lamp Operator... (Code that doesn't work)
01 | if game.Lighting:GetMinutesAfterMidnight() = = 18 * 60 then |
03 | script.Parent.Material = Enum.Material.Neon |
05 | script.Parent.PointLight.Enabled = true |
07 | if game.Lighting:GetMinutesAfterMidnight() = = 6 * 60 then |
09 | script.Parent.Material = Enum.Material.Plastic |
11 | script.Parent.PointLight.Enabled = false |
Day/Night cycle... (Code that works)
1 | lightPart = game.Workspace.Model.Lightpart |
2 | minutesafterMidnight = 0 |
4 | minutesafterMidnight = minutesafterMidnight + 5 |
5 | game.Lighting:SetMinutesAfterMidnight(minutesafterMidnight) |
As for why I chose to separate those two codes, it's because I notice that the codes do not run independently from each other so whenever I add in a debounce in the Lamp Operator, the Day/Night cycle stops for that rebound to.