This is the timer script for my upcoming Ninja Warrior tournament and I'm having trouble trying to count by tenths of a second. When I do try it, the first 10 intervals (90 to 89) display normally, and then each other number is off by about .0000000004, which is called roundoff error. How do I fix this so it doesn't give me crazy numbers?
script.Parent.MouseClick:Connect(function()
for i = 90,0,-0.1 do
for _,p in pairs(game.Players:GetPlayers()) do
p.PlayerGui.ScreenGui.Timer.Text = tostring(i)
end
if i == 0 then
for _,u in pairs(game.Players:GetPlayers()) do -- "u" is a metaphor variable that stands for "User"
u.PlayerGui.ScreenGui.Timer.Text = "Failure!"
end
game.Workspace:FindFirstChild("Clear", true).Disabled = true
end
end
end)
