function checkTeams(g)return not(sameTeam(g)and not FriendlyFire)end function onTouched(g)if g:IsDescendantOf(Tool.Parent)then return end if not HitAble then return end if g.Parent and g.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")then local F=g.Parent.Humanoid if contains(HitVictims,F)then return end local b=g.Parent:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if b and not b.Anchored then local g=Tool.Parent:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if g and checkTeams(F)then local J=b.Position-g.Position F.Sit=true tagHuman(F)F:TakeDamage(HitDamage)table.insert(HitVictims,F)local v=Instance.new("\066\111\100\121\086\101\108\111\099\105\116\121")v.maxForce=Vector3.new(1000000000.0,1000000000.0,1000000000.0)v.velocity=J.unit*128 v.Parent=b;(game:GetService("\068\101\098\114\105\115")):AddItem(v,.05)Handle.Smack.Pitch=math.random(90,110)/100 Handle.Smack.TimePosition=.15 Handle.Smack:Play()end end end end function onEquip()local g=Tool.Parent local F=Tool.ArmMesh:Clone()F.Parent=g:FindFirstChild("\082\105\103\104\116 \065\114\109")ArmMesh=F end function onUnequip()if ArmMesh then ArmMesh:Destroy()ArmMesh=nil end end function onLeftDown()if not SwingAble then return end SwingAble=false delay(SwingRestTime,function()SwingAble=true end)delay(HitWindup,function()HitAble=true delay(HitWindow,function()HitAble=false end)end)HitVictims={}Remote:FireClient(getPlayer(),"\080\108\097\121\065\110\105\109\097\116\105\111\110","\083\119\105\110\103")wait(.25)Handle.Boom.Pitch=math.random(80,100)/100 Handle.Boom:Play()end function onRemote(g,F,...)if g~=getPlayer()then return end if F=="\076\101\102\116\068\111\119\110"then onLeftDown(...)end end Tool.Equipped:connect(onEquip)Tool.Unequipped:connect(onUnequip)Handle.Touched:connect(onTouched)Remote.OnServerEvent:connect(onRemote)
--use this to determine if you want this human to be harmed or not, returns boolean
function checkTeams(otherHuman)
	return not (sameTeam(otherHuman) and not FriendlyFire)
end

function onTouched(part)
	if part:IsDescendantOf(Tool.Parent) then
		return
	end
	if not HitAble then
		return
	end

	if part.Parent and part.Parent:FindFirstChild("Humanoid") then
		local human = part.Parent.Humanoid

		if contains(HitVictims, human) then
			return
		end

		local root = part.Parent:FindFirstChild("HumanoidRootPart")
		if root and not root.Anchored then
			local myRoot = Tool.Parent:FindFirstChild("HumanoidRootPart")
			if myRoot and checkTeams(human) then
				local delta = root.Position - myRoot.Position

				human.Sit = true
				tagHuman(human)
				human:TakeDamage(HitDamage)
				table.insert(HitVictims, human)

				local bv = Instance.new("BodyVelocity")
				bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
				bv.velocity = delta.unit * 128
				bv.Parent = root
				game:GetService("Debris"):AddItem(bv, 0.05)

				Handle.Smack.Pitch = math.random(90, 110) / 100
				Handle.Smack.TimePosition = 0.15
				Handle.Smack:Play()
			end
		end
	end
end

function onEquip()
	--put in our right arm
	local char = Tool.Parent
	local arm = Tool.ArmMesh:Clone()
	arm.Parent = char:FindFirstChild("Right Arm")
	ArmMesh = arm
end

function onUnequip()
	if ArmMesh then
		ArmMesh:Destroy()
		ArmMesh = nil
	end
end

function onLeftDown()
	if not SwingAble then
		return
	end

	SwingAble = false
	delay(SwingRestTime, function()
		SwingAble = true
	end)

	delay(HitWindup, function()
		HitAble = true
		delay(HitWindow, function()
			HitAble = false
		end)
	end)

	HitVictims = {}

	Remote:FireClient(getPlayer(), "PlayAnimation", "Swing")

	wait(0.25)
	Handle.Boom.Pitch = math.random(80, 100) / 100
	Handle.Boom:Play()
end

function onRemote(player, func, ...)
	if player ~= getPlayer() then
		return
	end

	if func == "LeftDown" then
		onLeftDown(...)
	end
end

Tool.Equipped:connect(onEquip)
Tool.Unequipped:connect(onUnequip)
Handle.Touched:connect(onTouched)
Remote.OnServerEvent:connect(onRemote)
