• Player movement.
    4 replies, posted
Is there a function that returns if the player is moving? Is there one that returns how fast a player is moving. Well without having to get there position and check if it changes. If not I'll just use that, I know how.
[url]http://wiki.garrysmod.com/?title=Entity.GetVelocity[/url]
ply:GetVelocity() returns a vector of each velocity in all 3 axes, X Y and Z. To get his speed rather than his velocity do ply:GetVelocity():Length() To check if he's moving, use [lua]if ply:GetVelocity():Length() > 0 then //code end[/lua]
Thank you, I looked up speed, sprint, run, but not velocity. Thank you.
[QUOTE=MegaJohnny;16453277]ply:GetVelocity() returns a vector of each velocity in all 3 axes, X Y and Z. To get his speed rather than his velocity do ply:GetVelocity():Length() To check if he's moving, use [lua]if ply:GetVelocity():Length() > 0 then //code end[/lua][/QUOTE] thats not how you sit in a chaaair :razz:
Sorry, you need to Log In to post a reply to this thread.