|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 05 Apr 2014 09:13 PM |
| how could I make it stop subtracting 1 when the text = "0"? |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
|
| 05 Apr 2014 10:01 PM |
You have to use tonumber
i'm asian |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 05 Apr 2014 11:46 PM |
thenum = tonumber(game.Workspace.lobby.timer.SurfaceGui.timelft.Text ) thenum = thenum - 1
i'm asian |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|