Tool=script.Parent Handle=Tool:WaitForChild("\072\097\110\100\108\101")Players=game:GetService("\080\108\097\121\101\114\115")Debris=game:GetService("\068\101\098\114\105\115")RunService=game:GetService("\082\117\110\083\101\114\118\105\099\101")black=BrickColor.new("\082\101\097\108\108\121 \098\108\097\099\107")DamageValues={BaseDamage=5,SlashDamage=11,LungeDamage=22}Damage=DamageValues.BaseDamage Sounds={Slash=Handle:WaitForChild("\083\119\111\114\100\083\108\097\115\104");Lunge=Handle:WaitForChild("\083\119\111\114\100\076\117\110\103\101"),Unsheath=Handle:WaitForChild("\085\110\115\104\101\097\116\104")}Animations={Slash=Tool:WaitForChild("\083\108\097\115\104")}ClientControl=Tool:FindFirstChild("\067\108\105\101\110\116\067\111\110\116\114\111\108")or Instance.new("\082\101\109\111\116\101\070\117\110\099\116\105\111\110")ClientControl.Name="\067\108\105\101\110\116\067\111\110\116\114\111\108"ClientControl.Parent=Tool function InvokeClient(X,l)pcall(function()ClientControl:InvokeClient(Player,X,l)end)end function TagHumanoid(X,l)local x=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")x.Name="\099\114\101\097\116\111\114"x.Value=l Debris:AddItem(x,2)x.Parent=X end function UntagHumanoid(X)for X,l in pairs(X:GetChildren())do if l:IsA("\079\098\106\101\099\116\086\097\108\117\101")and l.Name=="\099\114\101\097\116\111\114"then l:Destroy()end end end function Blow(X)if not X or not X.Parent or not Character or not Humanoid or Humanoid.Health==0 then return end local l=X.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")if l and(l~=Humanoid and l.Health>0)then local x=Character:FindFirstChild("\082\105\103\104\116 \065\114\109")if not x then return end local I=game.Players:FindFirstChild(X.Parent.Name)local Q=Player.TeamColor local U=I.TeamColor local a=x:FindFirstChild("\082\105\103\104\116\071\114\105\112")if a and(a.Part0==Handle or a.Part1==Handle)then if I and(I~=Player and(not Player.Neutral and(not I.Neutral and(Q~=U or Q==black and U==black))))then UntagHumanoid(l)TagHumanoid(l,Player)l:TakeDamage(Damage)end end end end function Attack()Damage=DamageValues.SlashDamage Sounds.Slash:Play()InvokeClient("\080\108\097\121\065\110\105\109\097\116\105\111\110",{Animation=Animations.Slash,Speed=1.5})end function Lunge()Damage=DamageValues.LungeDamage Sounds.Lunge:Play()local X=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")X.Name="\116\111\111\108\097\110\105\109"X.Value="\076\117\110\103\101"X.Parent=Tool local l=Instance.new("\066\111\100\121\086\101\108\111\099\105\116\121")if Torso and Torso.Parent then l.velocity=Vector3.new(0,100,0)l.maxForce=Vector3.new(0,4000,0)Debris:AddItem(l,.5)l.Parent=Torso end wait(.25)if Torso and Torso.Parent then l.velocity=Torso.CFrame.lookVector*120+Vector3.new(0,60,0)end wait(.5)if l and l.Parent then l:Destroy()end wait(.5)Damage=DamageValues.SlashDamage end Tool.Enabled=true LastAttack=0 function Activated()if not Tool.Enabled then return end Tool.Enabled=false Tick=RunService.Stepped:wait()if Tick-LastAttack<.2 then Lunge()else Attack()end LastAttack=Tick Tool.Enabled=true end function Equipped()Character=Tool.Parent Player=Players:GetPlayerFromCharacter(Character)Humanoid=Character:FindFirstChild("\072\117\109\097\110\111\105\100")Torso=Character:FindFirstChild("\084\111\114\115\111")if not Player or not Humanoid or Humanoid.Health==0 or not Torso then return end Sounds.Unsheath:Play()end function Unequipped() end Tool.Activated:connect(Activated)Tool.Equipped:connect(Equipped)Tool.Unequipped:connect(Unequipped)Connection=Handle.Touched:connect(Blow)


Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")

black = BrickColor.new("Really black")

DamageValues = {
	BaseDamage = 5,
	SlashDamage = 11,
	LungeDamage = 22
}

Damage = DamageValues.BaseDamage

Sounds = {
	Slash = Handle:WaitForChild("SwordSlash"),
	Lunge = Handle:WaitForChild("SwordLunge"),
	Unsheath = Handle:WaitForChild("Unsheath")
}

Animations = {
	Slash = Tool:WaitForChild("Slash")
}

ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Tool

function InvokeClient(Mode, Value)
	pcall(function()
		ClientControl:InvokeClient(Player, Mode, Value)
	end)
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 Character or not Humanoid or Humanoid.Health == 0 then
		return
	end
	local humanoid = Hit.Parent:FindFirstChild("Humanoid")
	if humanoid and humanoid ~= Humanoid and humanoid.Health > 0 then
		local RightArm = Character:FindFirstChild("Right Arm")
		if not RightArm then
			return
		end
		local player = game.Players:FindFirstChild(Hit.Parent.Name)
		local myteam = Player.TeamColor
		local theirteam = player.TeamColor
		local RightGrip = RightArm:FindFirstChild("RightGrip")
		if (RightGrip and (RightGrip.Part0 == Handle or RightGrip.Part1 == Handle)) then
			if player and player ~= Player and not Player.Neutral and not player.Neutral and (myteam ~= theirteam or (myteam == black and theirteam == black)) then
				UntagHumanoid(humanoid)
				TagHumanoid(humanoid, Player)
				humanoid:TakeDamage(Damage)	
			end
		end
	end
end

function Attack()
	Damage = DamageValues.SlashDamage
	Sounds.Slash:Play()
	InvokeClient("PlayAnimation", {Animation = Animations.Slash, Speed = 1.5})
end

function Lunge()
	Damage = DamageValues.LungeDamage

	Sounds.Lunge:Play()

	local Anim = Instance.new("StringValue")
	Anim.Name = "toolanim"
	Anim.Value = "Lunge"
	Anim.Parent = Tool
	
	local Force = Instance.new("BodyVelocity")
	if Torso and Torso.Parent then
		Force.velocity = Vector3.new(0, 100, 0)
		Force.maxForce = Vector3.new(0, 4000, 0)
		Debris:AddItem(Force, 0.5)
		Force.Parent = Torso
	end
	
	wait(0.25)
	
	if Torso and Torso.Parent then
		Force.velocity = (Torso.CFrame.lookVector * 120)  + Vector3.new(0, 60, 0)
	end
	
	wait(0.5)
	
	if Force and Force.Parent then
		Force:Destroy()
	end
	
	wait(0.5)

	Damage = DamageValues.SlashDamage
end

Tool.Enabled = true
LastAttack = 0

function Activated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	Tick = RunService.Stepped:wait()

	if (Tick - LastAttack < 0.2) then
		Lunge()
	else
		Attack()
	end

	LastAttack = Tick

	--wait(0.5)

	Tool.Enabled = true
end

function Equipped()
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	Torso = Character:FindFirstChild("Torso")
	if not Player or not Humanoid or Humanoid.Health == 0 or not Torso then
		return
	end
	Sounds.Unsheath:Play()
end

function Unequipped()
end

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

Connection = Handle.Touched:connect(Blow)
