Here is my code:
local player = game.Players.LocalPlayer
local character = player.character or script.Parent
local humanoid = character.humanoid
local UserInputService = game:GetService("UserInputService")
local AnimationID = 'rbxassetid://5150687024'
local key = 'LeftControl'
UserInputService.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
if Input.KeyCode == Enum.KeyCode[key] then
local animation = Instance.new("Animation")
animation.AnimationID = AnimationID
local loadAnimation = humanoid:loadAnimation(animation)
loadAnimation:Play()
end
end)
My problem is that I am attempting to keybind a sprint animation to Left Control, however it wont run in game. Please help if possible!

2 comments
Under all circumstances, do not, take advice from the answer by @0kJu5tSp4ng3