Skip to content

GetPlayerVelocity

The player’s velocity in metres per second.

GetPlayerVelocity(pid)
Parameter Type
pid number the player

number, number, number - three numbers vx, vy, vz; nil when not connected

local vx, vy = GetPlayerVelocity(pid)
local speed = math.sqrt(vx * vx + vy * vy) -- ~1.5 walking, ~4 running, ~6.5 sprinting

GetPlayerPos · the Players group of the index