Is player moving?

How can I detect if a player is moving or standing? (If you are wondering why I ask this, it’s because I’m making a Motion Sensor)

[lua]if player:GetVelocity():Length() > 0 then
– Player is moving
end[/lua]

Mersi boku, lol.