local player = game.Players.LocalPlayer local mouse = player:GetMouse() local Animate local Humaniod = player.Character:FindFirstChild("Humaniod") mouse.KeyDown:Connect(function(Key) if Key == "c" then local Animation = Instance.new("Animation",player.Character) Animation.AnimationId = "rbxassetid://4934205080" Animate = Humaniod:LoadAnimation(Animation) Animation:Play() end end) mouse.KeyUp:Connect(function(Key) if Key == "c" then Animate:Stop() end end)
The output says: Workspace.EpicLLBro.LocalScript:10: attempt to index nil with 'LoadAnimation'
Some typos, don't worry!
Also the Animation:Play()
should be Animate:Play()
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local Animate local Humanoid = player.Character:FindFirstChild("Humanoid") mouse.KeyDown:Connect(function(Key) if Key == "c" then local Animation = Instance.new("Animation",player.Character) Animation.AnimationId = "rbxassetid://4934205080" Animate = Humanoid:LoadAnimation(Animation) Animate:Play() end end) mouse.KeyUp:Connect(function(Key) if Key == "c" then Animate:Stop() end end)