I made a simple obby timer script that increases the number on a text label every 0.1 seconds, but it doesn’t seem to be working and I’m not sure why?
local Player = game:GetService("Players").LocalPlayer
local Time = 0
script.Parent.Text = Time
while true do
if Player.leaderstats.Stage.Value > 1 and Player.leaderstats.Stage.Value <= 14 then
wait(0.1)
Time = Time + 0.1
script.Parent.Text = Time
end
end
local Player = game:GetService("Players").LocalPlayer
local Time = 0
script.Parent.Text = tostring(Time)
while true do
if Player.leaderstats.Stage.Value > 1 and Player.leaderstats.Stage.Value <= 14 then
wait(0.1)
Time = Time + 0.1
script.Parent.Text = tostring(Time)
else
wait()
end
end
local Player = game:GetService("Players").LocalPlayer
local Time = 0
script.Parent.Text = tostring(Time)
while true do
if Player.leaderstats.Stage.Value > 1 and Player.leaderstats.Stage.Value <= 14 then
wait(0.1)
Time = Time + 0.1
script.Parent.Text = tostring(string.sub(tostring(Time), 1, string.len(tostring(Time)) / 3))
else
wait()
end
end
local Player = game:GetService("Players").LocalPlayer
local Time = 0
script.Parent.Text = tostring(Time)
while true do
if Player.leaderstats.Stage.Value > 1 and Player.leaderstats.Stage.Value <= 14 then
wait(0.1)
Time = Time + 0.1
script.Parent.Text = tostring(string.sub(tostring(Time), 1, string.len(tostring(Time)) / 3))
else
wait()
end
end
local Player = game:GetService("Players").LocalPlayer
local Time = 0
script.Parent.Text = tostring(Time)
while true do
if Player.leaderstats.Stage.Value > 1 and Player.leaderstats.Stage.Value <= 14 then
wait(0.1)
Time = Time + 0.1
script.Parent.Text = tostring(string.format("%.3f", tostring(Time)))
else
wait()
end
end
local Player = game:GetService("Players").LocalPlayer
local Time = 0
script.Parent.Text = tostring(Time)
while true do
if Player.leaderstats.Stage.Value > 1 and Player.leaderstats.Stage.Value <= 14 then
wait(0.1)
Time = Time + 0.1
script.Parent.Text = tostring(string.format("%.1f", tostring(Time)))
else
wait()
end
end
local Player = game:GetService("Players").LocalPlayer
local Time = 0
script.Parent.Text = tostring(Time)
while true do
if Player.leaderstats.Stage.Value > 1 and Player.leaderstats.Stage.Value <= 14 then
wait(0.1)
Time = Time + 0.1
script.Parent.Text = tostring(string.format("%.1f", tostring(Time)))
else
wait()
end
end