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

How do you tell when a player is walking backwards? [closed]

Asked by
DemGame 271 Moderation Voter
4 years ago

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

Closed as Not Constructive by LennyPlayzYT, imKirda, and JesseSong

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

0
you copied like years old script that should not be used, use UserInputService instead of KeyDown imKirda 4491 — 4y
Ad