--Varables
local Form1 = script:WaitForChild("FirstForm")
local equipped = false
local UIS = game:GetService("UserInputService")
local tool = game.Players.LocalPlayer:WaitForChild("Backpack")
local Sword = tool:WaitForChild("Sword")

--Animate
Sword.Equipped:Connect(function()
	equipped = true
end)

Sword.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 = Sword.Parent:WaitForChild("Humanoid")
		local AnimTrack = Humanoid:LoadAnimation(Form1)

		AnimTrack:Play()
	end
end

3 comments

1

Next time, please provide more explanation. We're not google, we're not akinator, we're not bots: we won't solve your problem easily without more information.

0

I don't see any part of the code that puts the sword in the backpack. If another script is supposed to do that, please share that one as well. Otherwise, there is your problem.

0

The Sword is located in starter pack