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 8 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 — 8y

1 answer

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

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

01game.Players.PlayerAdded:connect(function(player)
02    player.CharacterAdded:connect(function(character)
03        local humanoid = character:FindFirstChild("Humanoid")
04        if humanoid then -- If we can find the humanoid
05            humanoid.Running:connect(function(WalkSpeed) -- connects the humanoid running function
06                if WalkSpeed == 0 then -- we know they are standing still
07                    print("Standing")
08                elseif WalkSpeed > 0 then -- we know that they are moving
09                    print("Running")
10                end
11            end)
12        end
13    end)
14end)
Ad

Answer this question