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

How can i make my animation play when W then Left Shift is pressed?

Asked by 2 years ago
Edited 2 years ago
local Animation = script.R6Run
wait(1)
local player = game.Players.LocalPlayer
local char = player.Character 
local hum = char.Humanoid
local R6RunTrack = hum:LoadAnimation(Animation)
local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.LeftShift then
        R6RunTrack:Play()
    end
end)

UIS.InputEnded:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.LeftShift then
        R6RunTrack:Stop()
    end
end)
0
Is there an error? Hieroglyphica 0 — 2y

Answer this question