|
| 17 Sep 2011 10:44 AM |
| i made a gui countdownclock but its not refreshing, all the variables are checking out correctly, and the loop supposedly chenging the text is printing out a msg that it is. every time i die it refreshes though. i dont know if i should switch to a hint bar or if theres a way to fix this. |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
| |
|
|
| 17 Sep 2011 10:49 AM |
| yea i know why it refreshes when it did, and yes my num vaues are in workspace. the problem is the gui doesnt show it counting down. like when i test, i start it at 3:60 wait a little, nothing happens. i die and it goes down how ever many seconds nbetween when i joined and when i died, say i joined and died 10 seconds later it would refresh at 3:50. but i want it to actually show it going from 3:60- 0:00 |
|
|
| Report Abuse |
|
|
|
| 17 Sep 2011 10:50 AM |
| its nothing wrong with the script, i just need to either add something or change to using a hint instead. |
|
|
| Report Abuse |
|
|
|
| 17 Sep 2011 11:25 AM |
Give us the script in the GUI that should update it. We can't help you if you dont :/ |
|
|
| Report Abuse |
|
|
|
| 17 Sep 2011 11:48 AM |
sorry, i didnt really think it was needed.
here it is.
local Min = game.Workspace.GameEngine.Time.Minutes.Value local Sec = game.Workspace.GameEngine.Time.Seconds.Value while true do wait() script.Parent.Time.TextLabel.Text = "Time Left: " ..Min.. ":" ..Sec end |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Sep 2011 11:58 AM |
local Min = game.Workspace.GameEngine.Time.Minutes.Value local Sec = game.Workspace.GameEngine.Time.Seconds.Value
These lines are the problem.
Basicly, what you did was that you set Min as the minute value and Sec as the second value AS THEY WERE WHEN THE SCRIPT RAN.
This doing, the variables Min and Sec never update, cause you have not made them to do it.
So, we cant use .Value while setting variables that change, so
local Min = game.Workspace.GameEngine.Time.Minutes -- Removed .Value local Sec = game.Workspace.GameEngine.Time.Seconds -- Remove .Value while true do wait() script.Parent.Time.TextLabel.Text = "Time Left: " ..Min.Value.. ":" ..Sec.Value -- Added .Value's end
Now, it checks for the value as it is when the loop runs, not as when the script ran.
:) |
|
|
| Report Abuse |
|
|
| |
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 17 Sep 2011 12:43 PM |
@call, and that's why I wanted the script :P It's a common error. |
|
|
| Report Abuse |
|
|