--Varables local Form1 = script:WaitForChild("FirstForm") local equipped = false local UIS = game:GetService("UserInputService") local tool = game.StarterPack.Sword --Animate tool.Equipped:Connect(function() equipped = true end) tool.Unequipped:Connect(function() equipped = false end) UIS.InputBegan:Connect(function(Input, isChatting) if isChatting then return end if Input.KeyCode == Enum.KeyCode.Q and equipped == true then local Humanoid = tool.Parent:WaitForChild("Humanoid") local AnimTrack = Humanoid:LoadAnimation(Form1) AnimTrack:Play() end end)
You defined tool as the sword in StarterPack. Instead, define tool as the sword the player is holding.
Change line 5 to this assuming that the script is parented to the tool
local tool = script.Parent