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

how do i find out f a player is standing still or stopped moving?

Asked by 7 years ago

https://gyazo.com/d25fbcfaca28d226f2eabaf3e67f8c9f

i searched the wiki but it doesnt have anything on standing still this isnt a request btw

0
Say something like if Running = false and Strafing == false then, dunno FlaminSparrow 65 — 7y

1 answer

Log in to vote
2
Answered by
Sxerks3 65
7 years ago

Don't know how effective my method is, but it should work if you put this inside a normal script.

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        local humanoid = character:FindFirstChild("Humanoid")
        if humanoid then -- If we can find the humanoid
            humanoid.Running:connect(function(WalkSpeed) -- connects the humanoid running function
                if WalkSpeed == 0 then -- we know they are standing still
                    print("Standing")
                elseif WalkSpeed > 0 then -- we know that they are moving
                    print("Running")
                end
            end)
        end
    end)
end)
Ad

Answer this question