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: repeat until sg

Previous Thread :: Next Thread 
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
05 Apr 2014 08:32 PM
If there's a textlabel, inside a surfacegui, could I do something like this?

repeat wait()
until game.Workspace.lobby.timer.timelft.Text -1

? I have a script that changes the text of it and I don't know how I could subtract 1 from the text if it's a number without doing this:

game.Workspace.blah.blah.Text = "178"
wait(1)
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
05 Apr 2014 08:34 PM
repeat game.Workspace.lobby.timer.SurfaceGui.timelft.Text -1
until game.Workspace.lobby.timer.SurfaceGui.timelft.Text == "0"

sorry
Report Abuse
transIate is not online. transIate
Joined: 20 Jun 2013
Total Posts: 2699
05 Apr 2014 09:08 PM
for i=1,178 do
workspace[lobby].Timer.TimeLeft.Text=i -1 end;

i think
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
05 Apr 2014 09:13 PM
how could I make it stop subtracting 1 when the text = "0"?
Report Abuse
transIate is not online. transIate
Joined: 20 Jun 2013
Total Posts: 2699
05 Apr 2014 09:15 PM
for i=1,178 do
workspace[lobby].Timer.TimeLeft.Text=i -1;
wait''if workspace[lobby].Timer.TimeLeft.Text='0'then
break
end;
end
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
05 Apr 2014 10:00 PM
'then' expected near '='
Report Abuse
JigglingJack is not online. JigglingJack
Joined: 25 Mar 2014
Total Posts: 11263
05 Apr 2014 10:01 PM
You have to use tonumber

i'm asian
Report Abuse
transIate is not online. transIate
Joined: 20 Jun 2013
Total Posts: 2699
05 Apr 2014 10:06 PM
what he said ^
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
05 Apr 2014 10:37 PM
Would this work?

game.Workspace.lobby.timer.SurfaceGui.timelft.Text = 180
repeat
wait(1)
game.Workspace.lobby.timer.SurfaceGui.timelft.Text =(tonumber("180") == 180) -1
until game.Workspace.lobby.timer.SurfaceGui.timelft.Text = "0"
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
05 Apr 2014 11:00 PM
I did this:

repeat
wait(1)
game.Workspace.lobby.timer.SurfaceGui.timelft.Text = (tonumber("180") == 180) -1
until game.Workspace.lobby.timer.SurfaceGui.timelft.Text == "0"

but it said in the output:

Workspace.Script:22 attempt to perform arithmetic on a Boolean value

line 22 is the (tonumber()) line
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
05 Apr 2014 11:45 PM
bump
#allthewaytothetop
Report Abuse
JigglingJack is not online. JigglingJack
Joined: 25 Mar 2014
Total Posts: 11263
05 Apr 2014 11:46 PM
thenum = tonumber(game.Workspace.lobby.timer.SurfaceGui.timelft.Text )
thenum = thenum - 1

i'm asian
Report Abuse
JigglingJack is not online. JigglingJack
Joined: 25 Mar 2014
Total Posts: 11263
05 Apr 2014 11:49 PM
num = tonumber(game.Workspace.lobby.timer.SurfaceGui.timelft.Text)
repeat
wait(1)
num = num - 1
game.Workspace.lobby.timer.SurfaceGui.timelft.Text = tostring(num)
until num = 0

i'm asian
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
06 Apr 2014 12:23 AM
This didn't work, so I just changed the text to Round in Progress. way simpler.

Thanks for all your help guys, finally got my first round script to work! :D
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