Player = script.Parent.Parent mouse = Player:GetMouse() local Animation = { Animation = { { id = "http://www.roblox.com/asset/?id=320954787"}}} function onKeyDown(key) key = key:lower() if key == "q" then Player.Character.Humanoid:LoadAnimation(Animation) end end mouse.KeyDown:connect (onKeyDown)
Output: Script 'Players.Player1.Backpack.LocalScript', Line 11
u didnt make the animation play and u make a array instead of a animation id
local Player = game.Players.LocalPlayer local mouse = Player:GetMouse() local animation = Instance.new('Animation') animation.AnimationId = 'rbxassetId://(id)' function OnKeyDown(key) key = key:lower() if key == 'q' then trackanim = Player.Character.Humanoid:LoadAnimation(animation) trackanim:Play() end end mouse.KeyDown:connect(OnKeyDown)