local startTime = os.clock()
local TextLabel = script.Parent
local BoolVal = game.ReplicatedStorage:WaitForChild("Touched")
local function sToHMS(s)
local h = math.floor(s/3600)
s = s % 3600
local m = math.floor(s/60)
s = s % 60
return string.format("%02i:%02i:%02i", h, m, s)
end
game:GetService("RunService").RenderStepped:Connect(function()
if BoolVal.Value then return end
TextLabel.Text = sToHMS(os.clock() - startTime)
end)
Alternating @XdJackyboiiXd21’s script and keeping @iamtryingtofindname’s point in mind, I came up with this. I guess you could try it out, I didn’t test it myself in Studio.
Edit: Forgot to do the string.format(), the actual reason why I wrote the post
This was the code that worked in my position. Thank you for solving the problems for the other devs participating and spending their time to help me out.
Well done!