The amount of damage dealt to a player is picked randomly. However, when tweening the health bar, it always takes 0.5 seconds. So if a lot of damage is dealt, the health bar moves quicker, while if a small amount of damage is done, it moves slower.
I want the numbers representing the player health to also emulate this through a for loop, for example:
for health = CurrentHealth, NewHealth, -1 do
HealthBar.Text = health
task.wait(Time)
end
The problem is, how would I calculate for task.wait(Time)
, so that the loop will always be finished by 0.5 seconds?