for J,k in pairs(Handle:GetChildren())do if k:IsA("\080\097\114\116\105\099\108\101\069\109\105\116\116\101\114")then k.Rate=20 end end Tool.Grip=Grips.Up Tool.Enabled=true function IsTeamMate(J,k)return J and(k and(not J.Neutral and(not k.Neutral and J.TeamColor==k.TeamColor)))end function TagHumanoid(J,k)local d=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")d.Name="\099\114\101\097\116\111\114"d.Value=k Debris:AddItem(d,2)d.Parent=J end function UntagHumanoid(J)for J,k in pairs(J:GetChildren())do if k:IsA("\079\098\106\101\099\116\086\097\108\117\101")and k.Name=="\099\114\101\097\116\111\114"then k:Destroy()end end end function Blow(J)if not J or not J.Parent or not CheckIfAlive()or not ToolEquipped then return end local k=Character:FindFirstChild("\082\105\103\104\116 \065\114\109")or Character:FindFirstChild("\082\105\103\104\116\072\097\110\100")if not k then return end local d=k:FindFirstChild("\082\105\103\104\116\071\114\105\112")if not d or d.Part0~=Handle and d.Part1~=Handle then return end local n=J.Parent if n==Character then return end local A=n:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")if not A or A.Health==0 then return end local Q=Players:GetPlayerFromCharacter(n)if Q and(Q==Player or IsTeamMate(Player,Q))then return end UntagHumanoid(A)TagHumanoid(A,Player)A:TakeDamage(Damage)end function Attack()Damage=DamageValues.SlashDamage Sounds.Slash:Play()if Humanoid then if Humanoid.RigType==Enum.HumanoidRigType.R6 then local J=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")J.Name="\116\111\111\108\097\110\105\109"J.Value="\083\108\097\115\104"J.Parent=Tool elseif Humanoid.RigType==Enum.HumanoidRigType.R15 then local J=Tool:FindFirstChild("\082\049\053\083\108\097\115\104")if J then local k=Humanoid:LoadAnimation(J)k:Play(0)end end end end function Lunge()Damage=DamageValues.LungeDamage Sounds.Lunge:Play()if Humanoid then if Humanoid.RigType==Enum.HumanoidRigType.R6 then local J=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")J.Name="\116\111\111\108\097\110\105\109"J.Value="\076\117\110\103\101"J.Parent=Tool elseif Humanoid.RigType==Enum.HumanoidRigType.R15 then local J=Tool:FindFirstChild("\082\049\053\076\117\110\103\101")if J then local k=Humanoid:LoadAnimation(J)k:Play(0)end end end wait(.2)Tool.Grip=Grips.Out wait(.2)Tool.Grip=Grips.Up Damage=DamageValues.SlashDamage end Tool.Enabled=true LastAttack=0 function Activated()if not Tool.Enabled or not ToolEquipped or not CheckIfAlive()then return end Tool.Enabled=false local J=RunService.Stepped:wait()if J-LastAttack<.2 then Lunge()else Attack()end LastAttack=J Damage=DamageValues.BaseDamage local k=Tool:FindFirstChild("\082\049\053\083\108\097\115\104")or(Create("\065\110\105\109\097\116\105\111\110"))({Name="\082\049\053\083\108\097\115\104",AnimationId=BaseUrl..Animations.R15Slash,Parent=Tool})local d=Tool:FindFirstChild("\082\049\053\076\117\110\103\101")or(Create("\065\110\105\109\097\116\105\111\110"))({Name="\082\049\053\076\117\110\103\101";AnimationId=BaseUrl..Animations.R15Lunge;Parent=Tool})Tool.Enabled=true end function CheckIfAlive()return(Player and(Player.Parent and(Character and(Character.Parent and(Humanoid and(Humanoid.Parent and(Humanoid.Health>0 and(Torso and Torso.Parent))))))))and true or false end function Equipped()Character=Tool.Parent Player=Players:GetPlayerFromCharacter(Character)Humanoid=Character:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")Torso=Character:FindFirstChild("\084\111\114\115\111")or Character:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if not CheckIfAlive()then return end ToolEquipped=true Sounds.Unsheath:Play()end function Unequipped()Tool.Grip=Grips.Up ToolEquipped=false end Tool.Activated:Connect(Activated)Tool.Equipped:Connect(Equipped)Tool.Unequipped:Connect(Unequipped)Connection=Handle.Touched:Connect(Blow)

for i, v in pairs(Handle:GetChildren()) do
	if v:IsA("ParticleEmitter") then
		v.Rate = 20
	end
end

Tool.Grip = Grips.Up
Tool.Enabled = true

function IsTeamMate(Player1, Player2)
	return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end

function TagHumanoid(humanoid, player)
	local Creator_Tag = Instance.new("ObjectValue")
	Creator_Tag.Name = "creator"
	Creator_Tag.Value = player
	Debris:AddItem(Creator_Tag, 2)
	Creator_Tag.Parent = humanoid
end

function UntagHumanoid(humanoid)
	for i, v in pairs(humanoid:GetChildren()) do
		if v:IsA("ObjectValue") and v.Name == "creator" then
			v:Destroy()
		end
	end
end

function Blow(Hit)
	if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then
		return
	end
	local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand")
	if not RightArm then
		return
	end
	local RightGrip = RightArm:FindFirstChild("RightGrip")
	if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
		return
	end
	local character = Hit.Parent
	if character == Character then
		return
	end
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if not humanoid or humanoid.Health == 0 then
		return
	end
	local player = Players:GetPlayerFromCharacter(character)
	if player and (player == Player or IsTeamMate(Player, player)) then
		return
	end
	UntagHumanoid(humanoid)
	TagHumanoid(humanoid, Player)
	humanoid:TakeDamage(Damage)	
end


function Attack()
	Damage = DamageValues.SlashDamage
	Sounds.Slash:Play()

	if Humanoid then
		if Humanoid.RigType == Enum.HumanoidRigType.R6 then
			local Anim = Instance.new("StringValue")
			Anim.Name = "toolanim"
			Anim.Value = "Slash"
			Anim.Parent = Tool
		elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
			local Anim = Tool:FindFirstChild("R15Slash")
			if Anim then
				local Track = Humanoid:LoadAnimation(Anim)
				Track:Play(0)
			end
		end
	end	
end

function Lunge()
	Damage = DamageValues.LungeDamage

	Sounds.Lunge:Play()
	
	if Humanoid then
		if Humanoid.RigType == Enum.HumanoidRigType.R6 then
			local Anim = Instance.new("StringValue")
			Anim.Name = "toolanim"
			Anim.Value = "Lunge"
			Anim.Parent = Tool
		elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
			local Anim = Tool:FindFirstChild("R15Lunge")
			if Anim then
				local Track = Humanoid:LoadAnimation(Anim)
				Track:Play(0)
			end
		end
	end	
	--[[
	if CheckIfAlive() then
		local Force = Instance.new("BodyVelocity")
		Force.velocity = Vector3.new(0, 10, 0) 
		Force.maxForce = Vector3.new(0, 4000, 0)
		Debris:AddItem(Force, 0.4)
		Force.Parent = Torso
	end
	]]
	
	wait(0.2)
	Tool.Grip = Grips.Out
	wait(0.2)
	Tool.Grip = Grips.Up

	Damage = DamageValues.SlashDamage
end

Tool.Enabled = true
LastAttack = 0

function Activated()
	if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
		return
	end
	Tool.Enabled = false
	local Tick = RunService.Stepped:wait()
	if (Tick - LastAttack < 0.2) then
		Lunge()
	else
		Attack()
	end
	LastAttack = Tick
	--wait(0.2)
	Damage = DamageValues.BaseDamage
	local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){
		Name = "R15Slash",
		AnimationId = BaseUrl .. Animations.R15Slash,
		Parent = Tool
	})
	
	local LungeAnim = (Tool:FindFirstChild("R15Lunge") or Create("Animation"){
		Name = "R15Lunge",
		AnimationId = BaseUrl .. Animations.R15Lunge,
		Parent = Tool
	})
	Tool.Enabled = true
end

function CheckIfAlive()
	return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false)
end

function Equipped()
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChildOfClass("Humanoid")
	Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart")
	if not CheckIfAlive() then
		return
	end
	ToolEquipped = true
	Sounds.Unsheath:Play()
end

function Unequipped()
	Tool.Grip = Grips.Up
	ToolEquipped = false
end

Tool.Activated:Connect(Activated)
Tool.Equipped:Connect(Equipped)
Tool.Unequipped:Connect(Unequipped)

Connection = Handle.Touched:Connect(Blow)
