Tool.Equipped:Connect(function()CheckTables()CanSwing=false if Settings.EquipAnim==true and(Tool.Animations:findFirstChild("\069\113\117\105\112")and Hum)then local S=Chr.Humanoid:LoadAnimation(Tool.Animations.Equip)S:Play()if Tool.Sounds:findFirstChild("\069\113\117\105\112")then Tool.Sounds.Equip:Play()end S.Stopped:wait()elseif Settings.EquipAnim==true then print(Plr.Name.."\'\115 \101\113\117\105\112 \097\110\105\109\097\116\105\111\110 \102\097\105\108\101\100\044 \114\101\113\117\105\114\101\109\101\110\116 \110\111\116 \109\101\116\046")end CanSwing=true end)Tool.Activated:Connect(function()if CanSwing==true and Hum.Health>0 then CanSwing=false CanDamage=true local S=PickThing("\083\119\105\110\103")local k=PickThing("\083\111\117\110\100")local F=Hum:LoadAnimation(S)F:Play()k:Play()wait(Settings.Cooldown)CanDamage=false CanSwing=true end end)Tool.Unequipped:Connect(function()CanSwing=false CanDamage=false end)Settings.Hitbox.Touched:Connect(function(S)local k=S.Parent if CanDamage==true then while not k:FindFirstChild("\072\117\109\097\110\111\105\100")and k.Parent~=game do k=k.Parent end local S=k:FindFirstChild("\072\117\109\097\110\111\105\100")if game.Players:findFirstChild(S.Parent.Name)then else if Settings.KillNPCs==true then if S.Health>0 then S:TakeDamage(Settings.Damage)CanDamage=false if S.Health<=0 then Plr.leaderstats.Kills.Value=Plr.leaderstats.Kills.Value+1 end end else return end end end end)
--PROBABLY WOULDNT TOUCH ABOVE UNLESS YOU KNOW WHAT YOURE DOING

Tool.Equipped:Connect(function()
	CheckTables() --Check if Table with list of Sounds and Animations are made. If not, make them. Please do not delete this

	CanSwing = false

	if Settings.EquipAnim == true and Tool.Animations:findFirstChild("Equip") and Hum then --if equip animation true and requirements are met, do this
		local EA = Chr.Humanoid:LoadAnimation(Tool.Animations.Equip)
		EA:Play()
		if Tool.Sounds:findFirstChild("Equip") then
			Tool.Sounds.Equip:Play()
		end
		EA.Stopped:wait()
	elseif Settings.EquipAnim == true then --if equip is true but you're missing an animation, print that so we know
		print(Plr.Name .. "'s equip animation failed, requirement not met.")
	end

	CanSwing = true
end)

Tool.Activated:Connect(function()
	if CanSwing == true and Hum.Health > 0 then --if youre able to swing and you arent dead
		CanSwing = false
		CanDamage = true
		local Swing = PickThing("Swing")
		local Sound = PickThing("Sound")

		--go though swings if more than one
		local SA = Hum:LoadAnimation(Swing)
		SA:Play()
		Sound:Play()

		wait(Settings.Cooldown)

		CanDamage = false
		CanSwing = true
	end
end)

Tool.Unequipped:Connect(function()
	CanSwing = false
	CanDamage = false
end)

Settings.Hitbox.Touched:Connect(function(Hit)
	local Mod = Hit.Parent

	if CanDamage == true then
		while not Mod:FindFirstChild("Humanoid") and Mod.Parent ~= game do
			Mod = Mod.Parent
		end
		local Hum = Mod:FindFirstChild("Humanoid")

		if game.Players:findFirstChild(Hum.Parent.Name) then
		else
			if Settings.KillNPCs == true then
				-- Check if target is not already dead
				if Hum.Health > 0 then
					Hum:TakeDamage(Settings.Damage)
					CanDamage = false

					-- Check if target is now dead
					if Hum.Health <= 0 then
						-- Increment Plr.leaderstats.Kills.Value by 1
						Plr.leaderstats.Kills.Value = Plr.leaderstats.Kills.Value + 1
					end
				end
			else
				return
			end
		end
	end
end)
