|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 01 Sep 2012 03:51 PM |
| I have no idea how to use changed either so I'm stuck :/ |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 01 Sep 2012 03:56 PM |
| It's a GUI... And hi Miz :P |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 01 Sep 2012 04:09 PM |
But TimeOfDay is a string...
(>•д•)> ¤¤ †KMXD† ¤¤ [SHG Tier~3] (^•д•^) [Freelancing Scripting Guru] <(•д•<) |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
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
|
  |
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 01 Sep 2012 04:53 PM |
| Did you add a wait to the localscript? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 01 Sep 2012 08:09 PM |
| Uh yeah. It's giving no output and isn't working at all. |
|
|
| Report Abuse |
|
|
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 |
|
|