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: gui text doesnt refresh in game?

Previous Thread :: Next Thread 
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
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 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
17 Sep 2011 10:46 AM
[ Content Deleted ]
Report Abuse
Fredfishy is not online. Fredfishy
Joined: 21 Mar 2009
Total Posts: 4197
17 Sep 2011 10:47 AM
Post the script?
Report Abuse
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
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
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
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
AntiBoomz0r is online. AntiBoomz0r
Joined: 02 Oct 2009
Total Posts: 1345
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
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
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
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
17 Sep 2011 11:56 AM
bumpp..
Report Abuse
AntiBoomz0r is online. AntiBoomz0r
Joined: 02 Oct 2009
Total Posts: 1345
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
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
17 Sep 2011 12:01 PM
amazing. thanks :D
Report Abuse
Fredfishy is not online. 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
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