How can i make my animation play when W then Left Shift is pressed?
Asked by
3 years ago Edited 3 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)