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 » Scripting Helpers
Home Search
 

Re: Streetlight Help

Previous Thread :: Next Thread 
YoshiDino123 is not online. YoshiDino123
Joined: 26 Mar 2012
Total Posts: 1045
14 Sep 2014 10:29 PM
So I was working on a script this afternoon that will turn on a streetlight and a Billboard GUI when it is a certain time:

print("Running")
wait(3)
t=game.Workspace.Lighting
sp=script.Parent.Glare

while true do
wait(0.01)
if t.TimeOfDay <= "17:30:00" then
sp.PointLight.Enabled=true
sp.BillboardGui.Enabled=true
end
if t.TimeOfDay <= "6:30:00" then
sp.PointLight.Enabled=false
sp.BillboardBui.Enabled=false
end
print("Still Working")
end

When I tested it, it didn't work. Please help?
Report Abuse
YoshiDino123 is not online. YoshiDino123
Joined: 26 Mar 2012
Total Posts: 1045
14 Sep 2014 10:37 PM
Pls
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
14 Sep 2014 10:40 PM
tonumber()
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
14 Sep 2014 10:46 PM
tonumber wouldn't be a smart idea in this scenario when there is a method in Lighting called

:GetMinutesAfterMidnight()

And

:SetMinutesAfterMidnight()
Report Abuse
YoshiDino123 is not online. YoshiDino123
Joined: 26 Mar 2012
Total Posts: 1045
14 Sep 2014 10:53 PM
I don't really understand.

To be honest, I used the wiki.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
14 Sep 2014 10:56 PM
17:30:00 is 17 hours and 30 minutes


17 hours * 60 = 1020 Minutes
1020 + 30 = 1050 minutes


if t:GetMinutesAfterMidnight() <= 1050 then
-- Understand it?
Report Abuse
YoshiDino123 is not online. YoshiDino123
Joined: 26 Mar 2012
Total Posts: 1045
14 Sep 2014 10:59 PM
Oh, thanks! I appreciate your help :D.
Report Abuse
YoshiDino123 is not online. YoshiDino123
Joined: 26 Mar 2012
Total Posts: 1045
14 Sep 2014 11:32 PM
It didn't work :S
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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