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")DamageValues={BaseDamage=5;SlashDamage=12,LungeDamage=16}Damage=DamageValues.BaseDamage Grips={Up=CFrame.new(0,0,-1.70000005,0,0,1,1,0,0,0,1,0),Out=CFrame.new(0,0,-1.70000005,0,1,0,1,0,0,0,0,-1)}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")}ToolEquipped=false Tool.Grip=Grips.Up Tool.Enabled=true function IsTeamMate(r,i)return r and(i and(not r.Neutral and(not i.Neutral and r.TeamColor==i.TeamColor)))end function TagHumanoid(r,i)local j=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")j.Name="\099\114\101\097\116\111\114"j.Value=i Debris:AddItem(j,2)j.Parent=r end function UntagHumanoid(r)for r,i in pairs(r:GetChildren())do if i:IsA("\079\098\106\101\099\116\086\097\108\117\101")and i.Name=="\099\114\101\097\116\111\114"then i:Destroy()end end end function Blow(r)if not r or not r.Parent or not CheckIfAlive()or not ToolEquipped then return end local i=Character:FindFirstChild("\082\105\103\104\116 \065\114\109")if not i then return end local j=i:FindFirstChild("\082\105\103\104\116\071\114\105\112")if not j or j.Part0~=Handle and j.Part1~=Handle then return end local t=r.Parent if t==Character then return end local x=t:FindFirstChild("\072\117\109\097\110\111\105\100")if not x or x.Health==0 then return end local E=Players:GetPlayerFromCharacter(t)if E and(E==Player or IsTeamMate(Player,E))then return end UntagHumanoid(x)TagHumanoid(x,Player)x:TakeDamage(Damage)end function Attack()Damage=DamageValues.SlashDamage Sounds.Slash:Play()local r=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")r.Name="\116\111\111\108\097\110\105\109"r.Value="\083\108\097\115\104"r.Parent=Tool end function Lunge()Damage=DamageValues.LungeDamage Sounds.Lunge:Play()local r=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")r.Name="\116\111\111\108\097\110\105\109"r.Value="\076\117\110\103\101"r.Parent=Tool if CheckIfAlive()then local r=Instance.new("\066\111\100\121\086\101\108\111\099\105\116\121")r.velocity=Vector3.new(0,10,0)r.maxForce=Vector3.new(0,4000,0)Debris:AddItem(r,.4)r.Parent=Torso end wait(.2)Tool.Grip=Grips.Out wait(.6)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 Tick=RunService.Stepped:wait()if Tick-LastAttack<.2 then Lunge()else Attack()end LastAttack=Tick 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:FindFirstChild("\072\117\109\097\110\111\105\100")Torso=Character:FindFirstChild("\084\111\114\115\111")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)
--Rescripted by Luckymaxer
--EUROCOW WAS HERE BECAUSE I MADE THE PARTICLES AND THEREFORE THIS ENTIRE SWORD PRETTY AND LOOK PRETTY WORDS AND I'D LIKE TO DEDICATE THIS TO MY FRIENDS AND HI LUCKYMAXER PLS FIX SFOTH SWORDS TY LOVE Y'ALl

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

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

DamageValues = {
	BaseDamage = 5,
	SlashDamage = 12,
	LungeDamage = 16,
}

Damage = DamageValues.BaseDamage

Grips = {
	Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0),
	Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1),
}

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

ToolEquipped = false

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")
	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:FindFirstChild("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()
	local Anim = Instance.new("StringValue")
	Anim.Name = "toolanim"
	Anim.Value = "Slash"
	Anim.Parent = Tool
end

function Lunge()
	Damage = DamageValues.LungeDamage

	Sounds.Lunge:Play()

	local Anim = Instance.new("StringValue")
	Anim.Name = "toolanim"
	Anim.Value = "Lunge"
	Anim.Parent = Tool

	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.6)
	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

	Tick = RunService.Stepped:wait()

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

	LastAttack = Tick

	--wait(0.5)

	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:FindFirstChild("Humanoid")
	Torso = Character:FindFirstChild("Torso")
	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)
