Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I Have A Problem! How To Detect When A Player Moves?

So I Want To Play An Animation When A Player Moves, But I Dont Know How To Detect it! Plees Halp

1 comment

0

while true do local L = "waitforplayertomove" end

1 answer

✓ Accepted answer

You can use the humanoid Running event in order to detect player movement.

game.Players.LocalPlayer.Humanoid.Running:Connect(function(speed)
    if speed > 2 then -- it's better to use something greater than zero
        print("the player is now moving")
    else
        print("the player has stopped")
    end
end)

Note that this is a client sided script, it's meant to go in a LocalScript.

2 comments

0

What if they're on mobile and they're walking? Then it doesn't work.

0

alright thanks for helping

This discussion is preserved as it was. New answers, comments, and votes are closed.