Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you tell when a player is walking backwards?

I would like to tell when a player is walking backwards so that I can stop a running animation. Any suggestions?

1 answer

Hi! This is the normal way. This should be a LocalScript inside StarterPlayer.PlayerScripts or wherever. Here.

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local target = game.Workspace:WaitForChild("--your username ")
local anim = target.WalkAnim --or whatever the path is. Just run the game, open the explorer and go to workspace, your avatar model then find the anim and put the path here

mouse.KeyDown:Connect(function(key)
if key == "s" then
anim:Pause()
end
end)

I stole the script, beside the anim part, here: https://scriptinghelpers.org/questions/15487/how-to-detect-if-a-player-presses-a-key-answered

I got the anim bit from here: My Brain

1 comment

0

you copied like years old script that should not be used, use UserInputService instead of KeyDown

This discussion is preserved as it was. New answers, comments, and votes are closed.