------------------


local Tool = script.Parent
local Humanoid
local Playing = false

local UIS = game:GetService("UserInputService")
local Animation = script:WaitForChild("Animation")
local AnimTrack


UIS.InputBegan:Connect(function(Input, GameProcessedEvent)
	if Input.KeyCode == Key and Humanoid and AnimTrack then
		if not GameProcessedEvent and not Playing then
			Playing = true
			AnimTrack:Play()
			wait(AnimationLength)
			Playing = false
		end
	end
end)

Tool.Equipped:Connect(function()
	Humanoid = Tool.Parent:FindFirstChildOfClass("Humanoid")
	AnimTrack = Humanoid:LoadAnimation(Animation)
end)
