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

1 comment
The script is what gives the value of the acceleration to the text which displays the acceleration. Basically I need a separate script that should take the Velocity.magnitude of the player 1 second ago. In other words, a 1 second delay of the Velocity.magnitude. Then in line 5, it's just the formula that subtracts the current Velocity.magnitude to the delayed Velocity.magnitude.