Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How To Know If Player Stopped Moving?

Asked by
Vezious 310 Moderation Voter
9 years ago

How Can You Find Out If A player has stopped moving? Or how can you check if someone has let go of the W Key?

1 answer

Log in to vote
0
Answered by 9 years ago

Checking if someone let go of the "W" key (and that only) wouldn't work, because of A, S, Spacebar, and D.

I'd check the player's MoveDirection.

Here's an example:

script.Parent.Humanoid.Changed:connect(function()
    wait(2.5)
    if script.Parent.Humanoid.TargetPoint.X == 0 and script.Parent.Humanoid.TargetPoint.Y == 0 and script.Parent.Humanoid.TargetPoint.Z == 0 then
    print("player is still.")
    end
    end)

Hope I helped!

Ad

Answer this question