Hello Devforum! I have come with another simple question. How could I make a stopwatch counting in decimals? I have already got it set up, but I do not know how to get it to count in decimals every second. This is what I have so far.
while wait(0.1) do
if hit.Parent.Humanoid.Health > 0 then
player.Timer.Value = player.Timer.Value + 0.1
else
print("Break loop")
timerdebounce = false
break
end
end
As you can see, this will count the timer slower than a second should count.
So, I am trying to make it so that the timer will count up in decimals to seconds. I do not know if this makes sense, but yea I am trying to make it go up by decimals to seconds. Like 0.01 to 1.
Is this stopwatch just for display purposes? (is the logic happening elsewhere?)
If so, you may want to consider using RenderStepped. The issue with your current implementation is that wait(0.1) is highly unlikely to actually wait for exactly 0.1 seconds, as it’s only accurate to 0.03 seconds, and is not meant for measurement of time. RenderStepped, however, passes the delta (time passed) between frames, providing you an accurate readout of how much time has passed without having to update the timer value unnecessarily (you don’t need the timer to update between frames).