|
| 10 Dec 2014 01:37 PM |
Hi everyone -
I've started to learn the LUA language and I need some help. I'm attempting to create a hint timer, where it counts down from 15 in seconds. I have a basic idea of what to do but not sure how to put to it together
Thanks in advance! |
|
|
| Report Abuse |
|
|
|
| 10 Dec 2014 06:10 PM |
To clarify...
Just a simple Hint at the top of the screen. Hint = Instance.new("Hint") Hint.Text = "Loading..." Hint.Parent = workspace
All I need it to do is countdown 15 seconds. Example: "15 seconds until the next round"
|
|
|
| Report Abuse |
|
|
|
| 10 Dec 2014 06:46 PM |
Hint = Instance.new("Hint") Hint.Text = "Loading..." Hint.Parent = workspace Hint.Text = "15 seconds left" Hint.Text = "14 seconds left" Hint.Text = "13 seconds left" Hint.Text = "12 seconds left" Hint.Text = "11 seconds left" Hint.Text = "10 seconds left" Hint.Text = "9 seconds left" Well, you should get the idea. |
|
|
| Report Abuse |
|
|
|
| 10 Dec 2014 06:50 PM |
I knew this was a possible option. But there is a simpler way to do this using a loop. However I don't know how to do so. |
|
|
| Report Abuse |
|
|
|
| 10 Dec 2014 06:54 PM |
for i = 15,1,-1 do Hint.Text = i.. " seconds left" wait(1) end
The third number is the number the loop counts by, so it goes from 15 to 1 subtracting 1 each time. |
|
|
| Report Abuse |
|
|
|
| 10 Dec 2014 06:55 PM |
| Thank you! I've been trying to get this to work! |
|
|
| Report Abuse |
|
|
| |
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 10 Dec 2014 08:06 PM |
nearly cried when someone suggested that huge block of code wiki.roblox.com/index.php?title=Writing_Clean_Code |
|
|
| Report Abuse |
|
|