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

How can I check if player is moving? [closed]

Asked by
Jo_Bot 67
6 years ago

I am using a custom character for my game, so things may be different, I am still using a Humanoid and everything else needed in a character, but I do not have an animation script.

So, I need to figure out how I can detect when the Player is moving at a certain WalkSpeed, and I cant seem to figure it out. This is what I tried.

humanoid.Running:connect(function(speed)
    if speed > 10 and speed < 16 then
        print("Running")
    end
end)
0
http://wiki.roblox.com/index.php?title=API:Vector3#Magnitude <Just a guess, but have you tried that? `Part.Velocity.Magnitude` TheeDeathCaster 2368 — 6y

Locked by JesseSong

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

This should work if you have declared your humanoid the correct way.

However, you are saying if speed is > 10 and < 16. The standard walkspeed of a player is 16, but this will only print if they are 11-15 consider changing to this

humanoid.Running:connect(function(speed)
    if speed >= 10 and speed <= 16 then
        print("Running")
    else 
    print('stopped Running') 
    end
end)
0
hmm, still not working, does humanoid.Running require the animation script or something? I dont use an animation script in my character. Jo_Bot 67 — 6y
0
hmm, i dont think so, i believe it just takes the walkspeed of the humanoid. Are you getting any errors? also, is there more to the script, like where you declare your variables like 'humanoid'? PoePoeCannon 519 — 6y
0
Yes, I declare "humanoid" with script.Parent.Humanoid(the script is in the character). I am not having any error messages. Maybe with custom characters it doesn't work. I tested it if it is running at all, it prints "Running", and that works, but just checking for speeds doesn't work. Maybe I should just try and check the humanoid.WalkSpeed with a Running event. Jo_Bot 67 — 6y
Ad