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: TimeOfDay

Previous Thread :: Next Thread 
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
01 Sep 2012 03:33 PM
Im making a watch for my game... But I can't seem to get it to display the same text as the TimeOfDay property in Lighting...
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
01 Sep 2012 03:43 PM
Bump.
Report Abuse
Sharpshooter26 is not online. Sharpshooter26
Joined: 26 May 2010
Total Posts: 5166
01 Sep 2012 03:46 PM
I have never used the CHanged. event but use that so when the Time changes it will change the GUI text box time


Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
01 Sep 2012 03:48 PM
Like when the TimeOfDay is changed I change the text to it? But wouldn't that need a while loop to make it keep going?
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
01 Sep 2012 03:51 PM
I have no idea how to use changed either so I'm stuck :/
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
01 Sep 2012 03:55 PM
h = Instance.new("Hint",Workspace)
h.Text = game.Lighting.TimeOfDay
game.Lighting.Changed:connect(function(change)
h.Text = game.Lighting.TimeOfDay
end)

if that doesn't work try tostringing it.
Report Abuse
Sharpshooter26 is not online. Sharpshooter26
Joined: 26 May 2010
Total Posts: 5166
01 Sep 2012 03:55 PM
Hmm, idk.

If you just want it to be for your game only do this inside the TextBox

(Assuming theres a value in it)

while wait(10) do

script.Parent.Time.Value = script.Parent.Time.Value + 100

end

That would work if the time is 3 digits, and would add 100 to whatever the time value is Ex. 4:00

Then have another loop to update the Text box

while wait(10) do script.Parent.Text = script.Parent.Time.Value

If they run Sync, it would update the Value then the time every 10 seconds.
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
01 Sep 2012 03:56 PM
It's a GUI... And hi Miz :P
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
01 Sep 2012 03:57 PM
...

If it's a gui then just do the same thing exept edit it so it shows the text on the gui instead of the hint.

And hi...:3
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
01 Sep 2012 04:06 PM
Doesn't work at all, here's the script:


timechanged = script.Parent.Time
timechanged.Text = game.Lighting.TimeOfDay
game.Lighting.Changed:connect(function(change)
timechanged.Text = game.Lighting.TimeOfDay
end)
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
01 Sep 2012 04:08 PM
timechanged = script.Parent.Time
timechanged.Text = tostring(game.Lighting.TimeOfDay)
game.Lighting.Changed:connect(function(change)
timechanged.Text = tostring(game.Lighting.TimeOfDay)
end)

Try that.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
01 Sep 2012 04:09 PM
But TimeOfDay is a string...

(>•д•)> ¤¤ †KMXD† ¤¤ [SHG Tier~3] (^•д•^) [Freelancing Scripting Guru] <(•д•<)
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
01 Sep 2012 04:11 PM
No dip sherlock... I know it is. But maybe the interpreter is like messed up or something so you have to make a string. I don't know. Sometimes Roblox studio is glitchy.
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
01 Sep 2012 04:21 PM
Didn't work :/
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
01 Sep 2012 04:22 PM
...

while wait(1) do
script.Parent.Time.Text = game.Lighting.TimeOfDay
end

Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
01 Sep 2012 04:25 PM
Oh, wait! Use the LightingChanged event!

http://wiki.roblox.com/index.php/LightingChanged_(Event)

I forgot about that event :3
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
01 Sep 2012 04:34 PM
It no work :(
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
01 Sep 2012 04:35 PM
Miz script should've worked in the first place. What's your setup, any output?

(>•д•)> ¤¤ †KMXD† ¤¤ [SHG Tier~3] (^•д•^) [Freelancing Scripting Guru] <(•д•<)
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
01 Sep 2012 04:36 PM
No output, and I basically have a Frame and inside it this in a LocalScript and a text label named Time.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
01 Sep 2012 04:53 PM
Did you add a wait to the localscript?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
01 Sep 2012 04:55 PM
So you have a ScreenGui, with a frame, and textlabel. Inside the Frame is the script. The ScreenGui is in the Player's PlayerGui?

(>•д•)> ¤¤ †KMXD† ¤¤ [SHG Tier~3] (^•д•^) [Freelancing Scripting Guru] <(•д•<)
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
01 Sep 2012 08:09 PM
Uh yeah. It's giving no output and isn't working at all.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
01 Sep 2012 09:17 PM
lol...

while true and wait() do
script.Parent.Text = string.sub(game.Lighting.TimeOfDay, 1, 5) --Displays hh:mm
end
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