|
| 17 Feb 2016 11:26 AM |
This works but it says Time Took when you touch it the first time, I tried tweaking it but it made it worse. I need to make it count and then pause and say Time Took when you touch it the second time.
local h = Instance.new("Hint")
local start = 0
h.Parent = game.Workspace
function onTouched(hit) for i = 1,999 do h.Text = i wait(1) while hit.Touched:wait() do local i = 1 h.Text = "Time it Took: "..i wait(1) i = i + 1 end end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
admin002
|
  |
| Joined: 09 Apr 2008 |
| Total Posts: 887 |
|
|
| 17 Feb 2016 11:38 AM |
Untested, but give it a shot:
local h = Instance.new("Hint")
local start = 0
h.Parent = game.Workspace
touchedOnce = false
i = 1;
function onTouched(hit) if touchedOnce == false then for i = 1,999 do h.Text = i wait(1) i = i + 1 touchedOnce = true end else while hit.Touched:wait() do h.Text = "Time it Took: "..i touchedOnce = false i = 1 wait(1) end end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
admin002
|
  |
| Joined: 09 Apr 2008 |
| Total Posts: 887 |
|
|
| 17 Feb 2016 11:40 AM |
| Actually I doubt that'll work. The loop will probably be blocking. |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2016 04:04 PM |
| Thanks for trying to help but it doesn't work. Anyone else care to try to make it work? please. |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2016 04:28 PM |
Can you explain what you're trying to do?
This siggy is copyrighted ©
|
|
|
| Report Abuse |
|
|
|
| 21 Feb 2016 08:45 AM |
| I'm trying to get the script to count up in 1's when you touch it first. Then when you touch it once again it stops on the digit you touched it and says something like "Time it took: (digit) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|