alguy1
|
  |
| Joined: 09 Jul 2014 |
| Total Posts: 10 |
|
|
| 21 Oct 2017 10:45 PM |
I have been having problems with getting all my streetlights to work in a map im trying to build and i was wondering if anyone here knows why only certain lights are working in this map. NOTE: I have checked and all the parts are named correctly
Heres the code:
lightPart = game.Workspace.Streetlight.LightPart minutesAfterMidnight = 0 while true do minutesAfterMidnight = minutesAfterMidnight + 10 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1) if game.Lighting:GetMinutesAfterMidnight() <= 360 or game.Lighting:GetMinutesAfterMidnight() >= 1080 then -- checks for 6AM lightPart.Material = Enum.Material.Neon lightPart.SpotLight.Enabled = true else lightPart.Material = Enum.Material.Plastic lightPart.SpotLight.Enabled = false end end
The time of day script is with this code. |
|
|
| Report Abuse |
|
|
SurKipper
|
  |
| Joined: 25 Dec 2011 |
| Total Posts: 435 |
|
|
| 21 Oct 2017 10:51 PM |
lightPart = game.Workspace.Streetlight.LightPart minutesAfterMidnight = 0
while true do minutesAfterMidnight = minutesAfterMidnight + 10 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1)
if game.Lighting:GetMinutesAfterMidnight() <= 360 then lightPart.Material = Enum.Material.Neon lightPart.SpotLight.Enabled = true elseif game.Lighting:GetMinutesAfterMidnight() >= 1080 then lightPart.Material = Enum.Material.Plastic lightPart.SpotLight.Enabled = false
end end |
|
|
| Report Abuse |
|
|
SurKipper
|
  |
| Joined: 25 Dec 2011 |
| Total Posts: 435 |
|
|
| 21 Oct 2017 10:54 PM |
add on the line directly below 'minutesAfterMidnight = minutesAfterMidnight + 10' this VV
if minutesAfterMidnight > (24 * 60) then minutesAfterMidnight = 0 |
|
|
| Report Abuse |
|
|
alguy1
|
  |
| Joined: 09 Jul 2014 |
| Total Posts: 10 |
|
|
| 22 Oct 2017 12:31 PM |
| I'm looking for the all the lights to turn on at 6:00pm and off at 6:00 am not to have the time reset at 6:00 am with my current code only # ##### follows the script |
|
|
| Report Abuse |
|
|