--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)
✓ ANSWER ACCEPTED
when i equip the tool and press Q nothing happens, what should I do?
1 answer
✓ Accepted answer
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
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
uhm the script is in starter player