Tool=script.Parent Handle=Tool:WaitForChild("\072\097\110\100\108\101")Fire=Handle:WaitForChild("\070\105\114\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")RbxUtility=LoadLibrary("\082\098\120\085\116\105\108\105\116\121")Create=RbxUtility.Create DeathEffect=script:WaitForChild("\068\101\097\116\104\069\102\102\101\099\116")DamageValues={BaseDamage=44,SlashDamage=50;LungeDamage=56}Damage=DamageValues.BaseDamage BaseUrl="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061"BasePart=Instance.new("\080\097\114\116")BasePart.Shape=Enum.PartType.Block BasePart.Material=Enum.Material.Plastic BasePart.TopSurface=Enum.SurfaceType.Smooth BasePart.BottomSurface=Enum.SurfaceType.Smooth BasePart.FormFactor=Enum.FormFactor.Custom BasePart.Size=Vector3.new(.2,.2,.2)BasePart.CanCollide=true BasePart.Locked=true BasePart.Anchored=false Special={Active=false;Enabled=true;Duration=15,CoolDown=10}Animations={Equip={Animation=Tool:WaitForChild("\069\113\117\105\112");FadeTime=nil;Weight=nil;Speed=.7,Duration=1},LeftSlash={Animation=Tool:WaitForChild("\076\101\102\116\083\108\097\115\104"),FadeTime=nil;Weight=nil,Speed=1.5;Duration=.75};RightSlash={Animation=Tool:WaitForChild("\082\105\103\104\116\083\108\097\115\104");FadeTime=nil;Weight=nil,Speed=1.5;Duration=.75};SideSwipe={Animation=Tool:WaitForChild("\083\105\100\101\083\119\105\112\101");FadeTime=nil;Weight=nil,Speed=.8;Duration=.75};Explode={Animation=Tool:WaitForChild("\069\120\112\108\111\100\101");FadeTime=.25;Weight=nil,Speed=2;Duration=.75}}Sounds={Unsheath=Handle:WaitForChild("\085\110\115\104\101\097\116\104");Slash=Handle:WaitForChild("\083\108\097\115\104"),Lunge=Handle:WaitForChild("\076\117\110\103\101")}Grips={Up=CFrame.new(0,-1.85,.05,1,0,0,0,1,0,0,0,1);Out=CFrame.new(0,-1.85,.05,1,0,0,0,0,-1,0,1,0)}LastAttack=0 ToolEquipped=false ServerControl=Tool:FindFirstChild("\083\101\114\118\101\114\067\111\110\116\114\111\108")or(Create("\082\101\109\111\116\101\070\117\110\099\116\105\111\110"))({Name="\083\101\114\118\101\114\067\111\110\116\114\111\108",Parent=Tool})ClientControl=Tool:FindFirstChild("\067\108\105\101\110\116\067\111\110\116\114\111\108")or(Create("\082\101\109\111\116\101\070\117\110\099\116\105\111\110"))({Name="\067\108\105\101\110\116\067\111\110\116\114\111\108",Parent=Tool})Handle.Transparency=0 Fire.Enabled=false Tool.Grip=Grips.Up Tool.Enabled=true function IsTeamMate(N,j)return N and(j and(not N.Neutral and(not j.Neutral and N.TeamColor==j.TeamColor)))end function TagHumanoid(N,j)local C=(Create("\079\098\106\101\099\116\086\097\108\117\101"))({Name="\099\114\101\097\116\111\114";Value=j})Debris:AddItem(C,2)C.Parent=N end function UntagHumanoid(N)for N,j in pairs(N:GetChildren())do if j:IsA("\079\098\106\101\099\116\086\097\108\117\101")and j.Name=="\099\114\101\097\116\111\114"then j:Destroy()end end end function CheckTableForInstance(N,j)for N,C in pairs(N)do if C==j then return true end end return false end function GetTotalParts(N,j,C)if N<j then return N elseif C>=N then return 0 elseif N>=j then local f=N-j if C<=N then f=N-C if f>j then return j else return f end elseif f>=j then return j else return f end end end function GetParts(N,j,C)local f={}local o=false while#f<j and not o do local l=N local b=GetTotalParts(j,3000,#f)local A=(game:GetService("\087\111\114\107\115\112\097\099\101")):FindPartsInRegion3WithIgnoreList(l,C,b)if#A==0 then o=true else for N,j in pairs(A)do table.insert(f,j)table.insert(C,j)end end end return f end function ApplyDeathEffect(N,j,C)local f=j or Vector3.new(0,0,0)local o=C or Vector3.new(0,0,0)local l=N:FindFirstChild("\072\117\109\097\110\111\105\100")if not l then return end local b=N:FindFirstChild(DeathEffect.Name)if b then return end b=DeathEffect:Clone()b.WindDirection.Value=f b.Force.Value=o b.Disabled=false b.Parent=N end function DealDamage(N,j)if not CheckIfAlive()or not N then return end local C=j or 0 local f=N:FindFirstChild("\072\117\109\097\110\111\105\100")local o=N:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if not o then o=N:FindFirstChild("\084\111\114\115\111")end if not f or f.Health==0 or not o then return end UntagHumanoid(f)TagHumanoid(f,Player)f:TakeDamage(C)if f.Health<=0 then local j=(CFrame.new(RootPart.Position,Vector3.new(o.Position.X,RootPart.Position.Y,o.Position.Z))*CFrame.Angles(0,math.pi,0)).lookVector ApplyDeathEffect(N,Vector3.new(j.X,1,j.Z),j*6.5+Vector3.new(0,15,0))end end function CheckIfAlive()return(Character and(Character.Parent and(Humanoid and(Humanoid.Parent and Humanoid.Health>0))))and true or false end function Blow(N)local j local C=false j=N.Touched:connect(function(N)if not N or not N.Parent or not CheckIfAlive()or not ToolEquipped or C then return end local j=Character:FindFirstChild("\082\105\103\104\116 \065\114\109")if not j then return end local f=j:FindFirstChild("\082\105\103\104\116\071\114\105\112")if not f or f.Part0~=Handle and f.Part1~=Handle then return end local o=N.Parent if o==Character or Special.Active and(RandomNearby and o~=RandomNearby.Character)then return end local l=o:FindFirstChild("\072\117\109\097\110\111\105\100")local b=o:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if not b then b=o:FindFirstChild("\084\111\114\115\111")end if not l or l.Health==0 or not b then return end local A=Players:GetPlayerFromCharacter(o)if A and(A==Player or IsTeamMate(Player,A))then return end C=true local J=Damage*(Special.Active and math.huge or 1)DealDamage(o,J)wait(.05)C=false end)end function PossessedAttack()Fire.Enabled=true local N=true if ToolUnequipped then ToolUnequipped:disconnect()end ToolUnequipped=Tool.Unequipped:connect(function()N=false end)local j=tick()while ToolEquipped and(N and(CheckIfAlive()and tick()-j<Special.Duration))do local N=Player local j=Character local C={j;Tool}local f=35 local o={}local l={}local b={}local A=RootPart.Position-Vector3.new(f,RootPart.Size.Y*1.25,f)local J=RootPart.Position+Vector3.new(f,f/6,f)for j,o in pairs(Players:GetChildren())do if o:IsA("\080\108\097\121\101\114")and o~=N then local j=o.Character if j and j.Parent then table.insert(C,o)if not IsTeamMate(o,N)then local N=j:FindFirstChild("\072\117\109\097\110\111\105\100")local C=j:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if not C then C=j:FindFirstChild("\084\111\114\115\111")end if N and(N.Health>0 and(RootPart.Position-C.Position).magnitude<=f)then table.insert(l,N)end end end end end if#l==0 then local N=GetParts(Region3.new(A,J),500,C)for N,j in pairs(N)do if j and(j.Parent and not CheckTableForInstance(o,j))then local N=j.Parent if N:IsA("\072\097\116")or N:IsA("\084\111\111\108")then N=N.Parent end local C=N:FindFirstChild("\072\117\109\097\110\111\105\100")local A=Players:GetPlayerFromCharacter(N)if not CheckTableForInstance(l,C)and not CheckTableForInstance(b,N)then if C and(C.Health>0 and not CheckTableForInstance(l,C))then table.insert(l,C)if A and not CheckTableForInstance(b,A)then table.insert(b,A)end elseif(RootPart.Position-j.Position).magnitude<=f then table.insert(o,j)end end end end end local R={}for N,j in pairs(l)do local C=j.Parent local f=Players:GetPlayerFromCharacter(C)local o=C:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if not o then o=C:FindFirstChild("\084\111\114\115\111")end if o then table.insert(R,{Character=C,Humanoid=j;RootPart=o;Distance=(RootPart.Position-o.Position).Magnitude})end end table.sort(R,function(N,j)return N.Distance<j.Distance end)if#R>0 then local N=3 local j=#R<=N and#R or N RandomNearby=R[math.random(1,j)]local C=RootPart.CFrame local f=RandomNearby.RootPart.CFrame*CFrame.new(0,(RootPart.Size.Z/2+RandomNearby.RootPart.Size.Z/2)+RootPart.Size.Y/2,(RootPart.Size.Z/2+RandomNearby.RootPart.Size.Z/2)+.75)RootPart.CFrame=CFrame.new(f.p,RandomNearby.RootPart.CFrame.p)RootPart.Anchored=true Attack()wait(1)RootPart.CFrame=C RootPart.Anchored=false wait(1.5)end wait()end Fire.Enabled=false end function Attack()Damage=DamageValues.SlashDamage Sounds.Slash:Play()local N={Animations.LeftSlash;Animations.RightSlash,Animations.SideSwipe;Animations.Swing}local j=N[math.random(1,#N)]Spawn(function()InvokeClient("\080\108\097\121\065\110\105\109\097\116\105\111\110",j)end)end function Lunge()Damage=DamageValues.LungeDamage Sounds.Lunge:Play()for N,j in pairs(Animations)do Spawn(function()InvokeClient("\083\116\111\112\065\110\105\109\097\116\105\111\110",j)end)end local N=(Create("\083\116\114\105\110\103\086\097\108\117\101"))({Name="\116\111\111\108\097\110\105\109";Value="\076\117\110\103\101"})Debris:AddItem(N,2)N.Parent=Tool wait(.2)Tool.Grip=Grips.Out wait(.75)Tool.Grip=Grips.Up Damage=DamageValues.SlashDamage end function Activated()if not Tool.Enabled or not ToolEquipped or not CheckIfAlive()or Special.Active then return end Tool.Enabled=false local N=RunService.Stepped:wait()if N-LastAttack<.2 then Lunge()else Attack()end LastAttack=N Damage=DamageValues.BaseDamage 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(RootPart and RootPart.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")RootPart=Character:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if not CheckIfAlive()then return end Sounds.Unsheath:Play()Spawn(function()if ToolUnequipped then ToolUnequipped:disconnect()end local N=true ToolUnequipped=Tool.Unequipped:connect(function()N=false end)local j=Animations.Equip Spawn(function()InvokeClient("\080\108\097\121\065\110\105\109\097\116\105\111\110",j)end)wait(j.Duration)if ToolUnequipped then ToolUnequipped:disconnect()end if not N then return end ToolEquipped=true Humanoid.WalkSpeed=24.0 end)end function Unequipped()Humanoid.WalkSpeed=16 ToolEquipped=false end function OnServerInvoke(N,j,C)if N~=Player or not ToolEquipped or not C or not CheckIfAlive()then return end if j=="\075\101\121\080\114\101\115\115\101\100"then local N=string.lower(C.Key)local j=C.Down if N=="\113"and j then if not Special.Enabled or Special.Active then return end Special.Enabled=false Special.Active=true PossessedAttack()Special.Active=false wait(Special.CoolDown)Special.Enabled=true end end end function InvokeClient(N,j)local C=nil pcall(function()C=ClientControl:InvokeClient(Player,N,j)end)return C end ServerControl.OnServerInvoke=OnServerInvoke Tool.Activated:connect(Activated)Tool.Equipped:connect(Equipped)Tool.Unequipped:connect(Unequipped)Blow(Handle)


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

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

RbxUtility = LoadLibrary("RbxUtility")
Create = RbxUtility.Create

DeathEffect = script:WaitForChild("DeathEffect")

DamageValues = {
	BaseDamage = 44,
	SlashDamage = 50,
	LungeDamage = 56,
}

Damage = DamageValues.BaseDamage

BaseUrl = "http://www.roblox.com/asset/?id="

BasePart = Instance.new("Part")
BasePart.Shape = Enum.PartType.Block
BasePart.Material = Enum.Material.Plastic
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = true
BasePart.Locked = true
BasePart.Anchored = false

Special = {
	Active = false,
	Enabled = true,
	Duration = 15,
	CoolDown = 10,
}

Animations = {
	Equip = {Animation = Tool:WaitForChild("Equip"), FadeTime = nil, Weight = nil, Speed = 0.7, Duration = 1},
	LeftSlash = {Animation = Tool:WaitForChild("LeftSlash"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.75},
	RightSlash = {Animation = Tool:WaitForChild("RightSlash"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = 0.75},
	SideSwipe = {Animation = Tool:WaitForChild("SideSwipe"), FadeTime = nil, Weight = nil, Speed = 0.8, Duration = 0.75},
	Explode = {Animation = Tool:WaitForChild("Explode"), FadeTime = 0.25, Weight = nil, Speed = 2, Duration = 0.75},
}

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

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

LastAttack = 0

ToolEquipped = false

ServerControl = (Tool:FindFirstChild("ServerControl") or Create("RemoteFunction"){
	Name = "ServerControl",
	Parent = Tool,
})

ClientControl = (Tool:FindFirstChild("ClientControl") or Create("RemoteFunction"){
	Name = "ClientControl",
	Parent = Tool,
})

Handle.Transparency = 0
Fire.Enabled = 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 = Create("ObjectValue"){
		Name = "creator",
		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 CheckTableForInstance(Table, Instance)
	for i, v in pairs(Table) do
		if v == Instance then
			return true
		end
	end
	return false
end

function GetTotalParts(MaxParts, PossibleParts, Parts)
	if MaxParts < PossibleParts then
		return MaxParts
	elseif Parts >= MaxParts then
		return 0
	elseif MaxParts >= PossibleParts then
		local PartCount = (MaxParts - PossibleParts)
		if Parts <= MaxParts then
			PartCount = (MaxParts - Parts)
			if PartCount > PossibleParts then
				return PossibleParts
			else
				return PartCount
			end
		elseif PartCount >= PossibleParts then
			return PossibleParts
		else
			return PartCount
		end
	end
end

function GetParts(Region, MaxParts, Ignore)
	local Parts = {}
	local RerunFailed = false
	while #Parts < MaxParts and not RerunFailed do
		local Region = Region
		local PossibleParts = GetTotalParts(MaxParts, 3000, #Parts)
		local PartsNearby = game:GetService("Workspace"):FindPartsInRegion3WithIgnoreList(Region, Ignore, PossibleParts)
		if #PartsNearby == 0 then
			RerunFailed = true
		else
			for i, v in pairs(PartsNearby) do
				table.insert(Parts, v)
				table.insert(Ignore, v)
			end
		end
	end
	return Parts
end

function ApplyDeathEffect(character, Direction, Force)
	local Direction = (Direction or Vector3.new(0, 0, 0))
	local Force = (Force or Vector3.new(0, 0, 0))
	local humanoid = character:FindFirstChild("Humanoid")
	if not humanoid then
		return
	end
	local DeathEffectCopy = character:FindFirstChild(DeathEffect.Name)
	if DeathEffectCopy then
		return
	end
	DeathEffectCopy = DeathEffect:Clone()
	DeathEffectCopy.WindDirection.Value = Direction
	DeathEffectCopy.Force.Value = Force
	DeathEffectCopy.Disabled = false
	DeathEffectCopy.Parent = character
end

function DealDamage(character, damage)
	if not CheckIfAlive() or not character then
		return
	end
	local damage = (damage or 0)
	local humanoid = character:FindFirstChild("Humanoid")
	local rootpart = character:FindFirstChild("HumanoidRootPart")
	if not rootpart then
		rootpart = character:FindFirstChild("Torso")
	end
	if not humanoid or humanoid.Health == 0 or not rootpart then
		return
	end
	UntagHumanoid(humanoid)
	TagHumanoid(humanoid, Player)
	humanoid:TakeDamage(damage)
	if humanoid.Health <= 0 then
		local WindDir = (CFrame.new(RootPart.Position, Vector3.new(rootpart.Position.X, RootPart.Position.Y, rootpart.Position.Z)) * CFrame.Angles(0, math.pi, 0)).lookVector
		ApplyDeathEffect(character, Vector3.new(WindDir.X, 1, WindDir.Z), ((WindDir * 6.5) + Vector3.new(0, 15, 0)))
	end
end

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

function Blow(Part)
	local PartTouched
	local HitDelay = false
	PartTouched = Part.Touched:connect(function(Hit)
		if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped or HitDelay 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 or (Special.Active and RandomNearby and character ~= RandomNearby.Character) then
			return
		end
		local humanoid = character:FindFirstChild("Humanoid")
		local rootpart = character:FindFirstChild("HumanoidRootPart")
		if not rootpart then
			rootpart = character:FindFirstChild("Torso")
		end
		if not humanoid or humanoid.Health == 0 or not rootpart then
			return
		end
		local player = Players:GetPlayerFromCharacter(character)
		if player and (player == Player or IsTeamMate(Player, player)) then
			return
		end
		HitDelay = true
		local TotalDamage = (Damage * ((Special.Active and math.huge) or 1))
		DealDamage(character, TotalDamage)
		wait(0.05)
		HitDelay = false
	end)
end

function PossessedAttack()
	Fire.Enabled = true
	local CurrentlyEquipped = true
	if ToolUnequipped then
		ToolUnequipped:disconnect()
	end
	ToolUnequipped = Tool.Unequipped:connect(function()
		CurrentlyEquipped = false
	end)
	local SpecialStart = tick()
	while ToolEquipped and CurrentlyEquipped and CheckIfAlive() and (tick() - SpecialStart) < Special.Duration do
		local UserPlayer = Player
		local UserCharacter = Character
		local IgnoreObjects = {UserCharacter, Tool}
		local Radius = 35
		local Objects = {}
		local Humanoids = {}
		local PlayersNearby = {}
		local NegativeRadius = (RootPart.Position - Vector3.new(Radius, (RootPart.Size.Y * 1.25), Radius))
		local PositiveRadius = (RootPart.Position + Vector3.new(Radius, (Radius / 6), Radius))
		for i, v in pairs(Players:GetChildren()) do
			if v:IsA("Player") and v ~= UserPlayer then
				local character = v.Character
				if character and character.Parent then
					table.insert(IgnoreObjects, v)
					if not IsTeamMate(v, UserPlayer) then
						local humanoid = character:FindFirstChild("Humanoid")
						local rootpart = character:FindFirstChild("HumanoidRootPart")
						if not rootpart then
							rootpart = character:FindFirstChild("Torso")
						end
						if humanoid and humanoid.Health > 0 and (RootPart.Position - rootpart.Position).magnitude <= Radius then
							table.insert(Humanoids, humanoid)
						end
					end
				end
			end
		end
		if #Humanoids == 0 then
			local Parts = GetParts(Region3.new(NegativeRadius, PositiveRadius), 500, IgnoreObjects)
			for i, v in pairs(Parts) do
				if v and v.Parent and not CheckTableForInstance(Objects, v) then
					local character = v.Parent
					if character:IsA("Hat") or character:IsA("Tool") then
						character = character.Parent
					end
					local humanoid = character:FindFirstChild("Humanoid")
					local player = Players:GetPlayerFromCharacter(character)
					if not CheckTableForInstance(Humanoids, humanoid) and not CheckTableForInstance(PlayersNearby, character) then
						if humanoid and humanoid.Health > 0 and not CheckTableForInstance(Humanoids, humanoid) then
							table.insert(Humanoids, humanoid)
							if player and not CheckTableForInstance(PlayersNearby, player) then
								table.insert(PlayersNearby, player)
							end
						elseif (RootPart.Position - v.Position).magnitude <= Radius then
							table.insert(Objects, v)
						end
					end
				end
			end
		end
		local NearPlayers = {}
		for i, v in pairs(Humanoids) do
			local character = v.Parent
			local player = Players:GetPlayerFromCharacter(character)
			local rootpart = character:FindFirstChild("HumanoidRootPart")
			if not rootpart then
				rootpart = character:FindFirstChild("Torso")
			end
			if rootpart then
				table.insert(NearPlayers, {Character = character, Humanoid = v, RootPart = rootpart, Distance = (RootPart.Position - rootpart.Position).Magnitude})
			end
		end
		table.sort(NearPlayers, (function(a, b)
			return a.Distance < b.Distance
		end))
		if #NearPlayers > 0 then
			local MaxNearbyCount = 3
			local MaxNearby = ((#NearPlayers <= MaxNearbyCount and #NearPlayers) or MaxNearbyCount)
			RandomNearby = NearPlayers[math.random(1, MaxNearby)]
			local OrigPos = RootPart.CFrame
			local NewPos = (RandomNearby.RootPart.CFrame * CFrame.new(0, ((RootPart.Size.Z / 2) + (RandomNearby.RootPart.Size.Z / 2) + (RootPart.Size.Y / 2)), ((RootPart.Size.Z / 2) + (RandomNearby.RootPart.Size.Z / 2) + 0.75)))
			RootPart.CFrame = CFrame.new(NewPos.p, RandomNearby.RootPart.CFrame.p)
			RootPart.Anchored = true
			Attack()
			wait(1)
			RootPart.CFrame = OrigPos
			RootPart.Anchored = false
			wait(1.5)
		end
		wait()
	end
	Fire.Enabled = false
end

function Attack()
	Damage = DamageValues.SlashDamage
	Sounds.Slash:Play()
	--[[local Anim = Create("StringValue"){
		Name = "toolanim",
		Value = "Slash",
	}
	Debris:AddItem(Anim, 2)
	Anim.Parent = Tool]]
	local SwingAnimations = {Animations.LeftSlash, Animations.RightSlash, Animations.SideSwipe, Animations.Swing}
	local Animation = SwingAnimations[math.random(1, #SwingAnimations)]
	Spawn(function()
		InvokeClient("PlayAnimation", Animation)
	end)
end

function Lunge()
	Damage = DamageValues.LungeDamage
	Sounds.Lunge:Play()
	for i, v in pairs(Animations) do
		Spawn(function()
			InvokeClient("StopAnimation", v)
		end)
	end
	local Anim = Create("StringValue"){
		Name = "toolanim",
		Value = "Lunge",
	}
	Debris:AddItem(Anim, 2)
	Anim.Parent = Tool
	wait(0.2)
	Tool.Grip = Grips.Out
	wait(0.75)
	Tool.Grip = Grips.Up
	Damage = DamageValues.SlashDamage
end

function Activated()
	if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() or Special.Active 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.5)
	Damage = DamageValues.BaseDamage
	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 RootPart and RootPart.Parent) and true) or false)
end

function Equipped()
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	RootPart = Character:FindFirstChild("HumanoidRootPart")
	if not CheckIfAlive() then
		return
	end
	Sounds.Unsheath:Play()
	Spawn(function()
		if ToolUnequipped then
			ToolUnequipped:disconnect()
		end
		local CurrentlyEquipped = true
		ToolUnequipped = Tool.Unequipped:connect(function()
			CurrentlyEquipped = false
		end)
		local Animation = Animations.Equip
		Spawn(function()
			InvokeClient("PlayAnimation", Animation)
		end)
		wait(Animation.Duration)
		if ToolUnequipped then
			ToolUnequipped:disconnect()
		end
		if not CurrentlyEquipped then
			return
		end
		ToolEquipped = true
		Humanoid.WalkSpeed = (16 * 1.5)
	end)
end

function Unequipped()
	Humanoid.WalkSpeed = 16
	ToolEquipped = false
end

function OnServerInvoke(player, mode, value)
	if player ~= Player or not ToolEquipped or not value or not CheckIfAlive() then
		return
	end
	if mode == "KeyPressed" then
		local Key = string.lower(value.Key)
		local Down = value.Down
		if Key == "q" and Down then
			if not Special.Enabled or Special.Active then
				return
			end
			Special.Enabled = false
			Special.Active = true
			PossessedAttack()
			Special.Active = false
			wait(Special.CoolDown)
			Special.Enabled = true
		end
	end
end

function InvokeClient(Mode, Value)
	local ClientReturn = nil
	pcall(function()
		ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
	end)
	return ClientReturn
end

ServerControl.OnServerInvoke = OnServerInvoke

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

Blow(Handle)
