Use math.round(). This is caused by floating point inaccuracies that you can read online.
script.Parent.MouseButton1Click:Connect(function()
local timeOut = 10
for i = timeOut, 0, -0.1 do
i = math.round(i * 1e4) / 1e4 -- Rounds to 4 zeroes
print(i)
task.wait(0.1)
end
end)
Also be careful with using for i = timeOut, 0, -0.1. It won’t activate the very last index if your rate is a repeating decimal like -(1 / 60), or irrational like math.pi.
Consider using an integer instead, like:
local timeOut = 10
for i = timeOut * 10, 0, -1 do
i /= 10
print(i)
task.wait(0.1)
end