generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Issue getting city streetlights on one script!

Previous Thread :: Next Thread 
alguy1 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image