Counting Players steps?

Is there a way to count a player’s steps and then add value to a leaderstat?

You could possibly use something like Humanoid:Running and check if the walk speed is > than 0.

Player.Humanoid.Running:Connect(function(speed)
    if speed > 0 then
        ---do stuff
    else
        ---dont do stuff
    end
end)

Or you could maybe use Humanoid:MoveDirection…

while wait() do
    if Humanoid.MoveDirection ~= vec3.new(0, 0, 0) then 
    --do stuff
    player.leaderstats.Steps.Value = player.leaderstats.Steps.Value + 1
    else
    --dont do stuff
    end
end

2 Likes

This article seems relevant to your goal. Try looking into this, along with quite a few other articles on the DevForum that are very similar to this.

1 Like