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: Help with Spotlight

Previous Thread :: Next Thread 
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
06 Feb 2014 09:29 AM
What would be the script to turn on and turn off a Torch using Spotlight? So when night comes, it turns on and when day comes it turns off?

I tried:
if game.Lighting.TimeOfDay == "07:00:00" then
script.Parent.Enabled = false -------The script is in the Spotlight
elseif game.Lighting.TimeOfDay == "18:00:00" then
script.Parent.Enabled = true
end

Tkx.
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
06 Feb 2014 09:30 AM
I forgot to say that the thing I tried isn't working.
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
06 Feb 2014 09:33 AM
You would have to use minutesaftermidnight.

if game.Lighting:GetMinutesAfterMidnight() == 420 then
script.Parent.Enabled = false -------The script is in the Spotlight
elseif game.Lighting:GetMinutesAfterMidnight() == 1080 then
script.Parent.Enabled = true
end
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
06 Feb 2014 09:41 AM
I see. Well it doesn't work :x I will try to work on it. Thank you
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
06 Feb 2014 06:48 PM
I don't know what is the problem... I tried to make the part transparent instead of the Spotlight enabled, and it worked, but it doesn't work for the Spotlight.
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
06 Feb 2014 06:55 PM
Why doesn't TimeOfDay work anymore?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Feb 2014 07:01 PM
because it probably never is EXACTLY that amount of mins past midnight, as if the script that is making is go ahead in time is not making it go to exactly that #, use gtr and lss
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
06 Feb 2014 09:09 PM
So we should always use Int values instead of String values? (Numbers instead of Characters)
Report Abuse
TehIcyStar is not online. TehIcyStar
Joined: 07 Mar 2010
Total Posts: 1649
06 Feb 2014 09:34 PM
Is it checking every (what so ever) seconds/minutes? or is that code triggered only once and never runned again?
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
06 Feb 2014 09:54 PM
In my case, lights shut down at 7:00:00 (works once) and should turn on at 18:00:00 (Doesn't work at all)
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