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: I have a text button to change the time of day to night.

Previous Thread :: Next Thread 
andrewdevs is not online. andrewdevs
Joined: 03 Jan 2013
Total Posts: 7932
09 Jul 2015 11:13 AM
It's not working, however. Could you tell me what's wrong?

function onButtonClicked()
game.Lighting.TimeOfDay = 1
end
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
09 Jul 2015 11:14 AM
Use game.Lighting:SetMinutesAfterMidnight(1) instead, because TimeOfDay expects a string like "xx:xx:xx" with the x's as numbers.
Report Abuse
andrewdevs is not online. andrewdevs
Joined: 03 Jan 2013
Total Posts: 7932
09 Jul 2015 11:19 AM
That didn't work. :(

Is there something wrong in my original script?
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
09 Jul 2015 12:08 PM
You must not have connected it to an event.
Report Abuse
andrewdevs is not online. andrewdevs
Joined: 03 Jan 2013
Total Posts: 7932
09 Jul 2015 02:26 PM
Sorry I'm new to this but how do I connect it to an event?
Report Abuse
xKillerGuy18x is not online. xKillerGuy18x
Joined: 07 Oct 2012
Total Posts: 216
09 Jul 2015 03:04 PM
* = Direction of your clickdetector

*.MouseClick:connect(onButtonClicked)

Adding that to your script should fix your problem.
Report Abuse
xKillerGuy18x is not online. xKillerGuy18x
Joined: 07 Oct 2012
Total Posts: 216
09 Jul 2015 03:04 PM
By direction I mean where it is located

ex: game.Workspace.ClickDetector
Report Abuse
andrewdevs is not online. andrewdevs
Joined: 03 Jan 2013
Total Posts: 7932
09 Jul 2015 03:16 PM
Isn't that for surface guis?
Report Abuse
xKillerGuy18x is not online. xKillerGuy18x
Joined: 07 Oct 2012
Total Posts: 216
09 Jul 2015 04:12 PM
Nope. MouseButton1Down is
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
09 Jul 2015 05:12 PM
script.Parent.MouseButton1Click:connect(function()
game.Lighting.TimeOfDay = "09:00:00"
end)


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
andrewdevs is not online. andrewdevs
Joined: 03 Jan 2013
Total Posts: 7932
09 Jul 2015 05:27 PM
IT WORKED

you're awesome tysm
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