local N=script.Parent local x=N.Handle local o=require(206209239)local w local V local K local p=false local m=game:GetService("\068\101\098\114\105\115")function tagHumanoid(N,x)if N then local o=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")o.Value=x o.Name="\099\114\101\097\116\111\114"o.Parent=N m:AddItem(o,1)end end function UntagHumanoid(N)for N,x in pairs(N:GetChildren())do if x:IsA("\079\098\106\101\099\116\086\097\108\117\101")and x.Name=="\099\114\101\097\116\111\114"then x:Destroy()end end end function cut(x)local V local p if x and(x.Parent and K)then if x.Parent:IsA("\065\099\099\111\117\116\114\101\109\101\110\116")then V=x.Parent.Parent:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")else V=x.Parent:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")end p=game.Players:GetPlayerFromCharacter(w)if V and(V~=K and not o.IsTeammate(o.GetPlayerFromPart(N),o.GetPlayerFromPart(V)))then UntagHumanoid(V)tagHumanoid(V,p)V:TakeDamage(27)end end end function onEquipped()w=N.Parent V=w:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")K=w:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")end N.Equipped:Connect(onEquipped)x.Touched:Connect(cut)


local Tool = script.Parent
local Sword = Tool.Handle
local GLib = require(206209239)

local vCharacter
local myTorso
local myHumanoid 

local equipped = false

local debris = game:GetService("Debris")

function tagHumanoid(humanoid, player)
	if humanoid then 
		local creatorTag = Instance.new("ObjectValue")
		creatorTag.Value = player
		creatorTag.Name = "creator"
		creatorTag.Parent = humanoid
		debris:AddItem(creatorTag, 1)
	end
end

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

function cut(hit)
	local humanoid
	local vPlayer
	if hit and hit.Parent and myHumanoid then 
		if hit.Parent:IsA("Accoutrement") then
			humanoid = hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
		else
			humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
		end
		vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
		if humanoid and humanoid ~= myHumanoid and not GLib.IsTeammate(GLib.GetPlayerFromPart(Tool), GLib.GetPlayerFromPart(humanoid)) then 
			UntagHumanoid(humanoid)
			tagHumanoid(humanoid, vPlayer)
			humanoid:TakeDamage(27)
		end
	end
end

function onEquipped()
	vCharacter = Tool.Parent
	myTorso = vCharacter:FindFirstChild("HumanoidRootPart")
	myHumanoid = vCharacter:FindFirstChildOfClass("Humanoid")	
end

Tool.Equipped:Connect(onEquipped)

Sword.Touched:Connect(cut)
