GetPlayerVelocity
The player’s velocity in metres per second.
Syntax
Section titled “Syntax”GetPlayerVelocity(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”number, number, number - three numbers vx, vy, vz; nil when not connected
Example
Section titled “Example”local vx, vy = GetPlayerVelocity(pid)local speed = math.sqrt(vx * vx + vy * vy) -- ~1.5 walking, ~4 running, ~6.5 sprintingSee also
Section titled “See also”GetPlayerPos · the Players group of the index
