I would like to create a script that would link to GUI text, counting up by seconds.
I am aiming to create something like this, but counting up.
Also, I want to stop the timer when I collide with a certain object/part.
Here is what I have so far:
local time = 0
for i = 1, 89934 do
wait(0.1)
time = time + 0.1
script.Parent.Text = tostring(time)
end
Location: StarterGUI>ScreenGUI>TextButton>Script
Also, the timer resets every time you die, is there a way to prevent this?
Thanks in advance, -MexheCo

4 comments
You shouldn't be using scripts to handle gui coding. Use a local script.
You should be using a (while do) loop rather than the (for do) loop.
You can stop the timer using a condition value. while hitpart == false do (timer loop) end. and then turn hitpart true by using Touched on the certain object.
Easier said than done. OP will need a RemoteEvent to do this.