I wanted to make an acceleration counter that shows the player's acceleration especially when falling or speeding up. I was thinking of having the player's Velocity.magnitude minus the Velocity.magnitude 1 SECOND AGO. This requires me to add a delay of 1 second on a while loop. Is there a way to delay the Velocity.magnitude reading by 1 second after the player moves?
math.randomseed(tick()) wait() boop = game.Players.LocalPlayer if boop.Character then player = boop.Character end while true do a = math.floor((((player.Head.Velocity.magnitude)-(--[[Velocity 1 second ago]])*2)*100))/100 script.Parent.Text = a .. " studs/s^2" wait() end
Something like...
repeat wait() until game.Players.LocalPlayer.Character game.Players.LocalPlayer.Character.Changed:connect(function() wait(1) a = math.floor((((player.Head.Velocity.magnitude)-(--[[Velocity 1 second ago]])*2)*100))/100 script.Parent.Text = a .. " studs/s^2" end)
...?