Pie=script.Parent Players=game:GetService("\080\108\097\121\101\114\115")Debris=game:GetService("\068\101\098\114\105\115")Creator=Pie:FindFirstChild("\099\114\101\097\116\111\114")BodyForce=Pie:FindFirstChild("\066\111\100\121\070\111\114\099\101")BodyGyro=Pie:FindFirstChild("\066\111\100\121\071\121\114\111")HitSound=Pie:FindFirstChild("\072\105\116")Stuck=false Damage=0 function TagHumanoid(E,A)local m=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")m.Name="\099\114\101\097\116\111\114"m.Value=A Debris:AddItem(m,2)m.Parent=E end function UntagHumanoid(E)for E,A in pairs(E:GetChildren())do if A:IsA("\079\098\106\101\099\116\086\097\108\117\101")and A.Name=="\099\114\101\097\116\111\114"then A:Destroy()end end end function Stick(E,A)local m=Instance.new("\087\101\108\100")m.Part0=Pie m.Part1=A local Y=Pie.Position local h=CFrame.new(Y)m.C0=Pie.CFrame:inverse()*h m.C1=A.CFrame:inverse()*h m.Parent=E return m end function IsTeamMate(E,A)return E and(A and(not E.Neutral and(not A.Neutral and E.TeamColor==A.TeamColor)))end function Touched(E)if not E or not E.Parent or Stuck then return end local A=E.Parent if A:IsA("\072\097\116")or A:IsA("\084\111\111\108")then A=A.Parent end local m if Creator and(Creator.Value and Creator.Value:IsA("\080\108\097\121\101\114"))then m=Creator.Value end if m and m.Character==A then return end local Y=Players:GetPlayerFromCharacter(A)if m and(Y and IsTeamMate(m,Y))then return end Stuck=true PieWeld=Stick(Pie,E)if HitSound then HitSound:Play()end for E,A in pairs({BodyForce,BodyGyro})do if A and A.Parent then A:Destroy()end end local h=A:FindFirstChild("\072\117\109\097\110\111\105\100")if h and h.Health>0 then UntagHumanoid(h)if m then TagHumanoid(h,m)end h:TakeDamage(Damage)end end Pie.Touched:connect(Touched)for E=1,10,1 do wait(.1*E)if BodyGyro and BodyGyro.Parent then local E=Pie.Velocity.unit BodyGyro.maxTorque=Vector3.new(10000.0,10000.0,10000.0)BodyGyro.cframe=CFrame.new(Vector3.new(0,0,0),-E)end end wait(2)if PieWeld and PieWeld.Parent then PieWeld:Destroy()end wait(8)Debris:AddItem(Pie,0)


Pie = script.Parent

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

Creator = Pie:FindFirstChild("creator")

BodyForce = Pie:FindFirstChild("BodyForce")
BodyGyro = Pie:FindFirstChild("BodyGyro")

HitSound = Pie:FindFirstChild("Hit")

Stuck = false

Damage = 0

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 Stick(Object, Hit)
	local Weld = Instance.new("Weld")
	Weld.Part0 = Pie
	Weld.Part1 = Hit
	local HitPos = Pie.Position
	local CJ = CFrame.new(HitPos)
	Weld.C0 = Pie.CFrame:inverse() * CJ
	Weld.C1 = Hit.CFrame:inverse() * CJ
	Weld.Parent = Object
	return Weld
end

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

function Touched(Hit)
	if not Hit or not Hit.Parent or Stuck then
		return
	end
	local character = Hit.Parent
	if character:IsA("Hat") or character:IsA("Tool") then
		character = character.Parent
	end
	local CreatorPlayer
	if Creator and Creator.Value and Creator.Value:IsA("Player") then
		CreatorPlayer = Creator.Value
	end
	if CreatorPlayer and CreatorPlayer.Character == character then
		return
	end
	local player = Players:GetPlayerFromCharacter(character)
	if CreatorPlayer and player and IsTeamMate(CreatorPlayer, player) then
		return
	end
	Stuck = true
	PieWeld = Stick(Pie, Hit)
	if HitSound then
		HitSound:Play()
	end
	for i, v in pairs({BodyForce, BodyGyro}) do
		if v and v.Parent then
			v:Destroy()
		end
	end
	local humanoid = character:FindFirstChild("Humanoid")
	if humanoid and humanoid.Health > 0 then
		UntagHumanoid(humanoid)
		if CreatorPlayer then
			TagHumanoid(humanoid, CreatorPlayer)
		end
		humanoid:TakeDamage(Damage)
	end
end

Pie.Touched:connect(Touched)

for i = 1, 10 do
	wait(0.1 * i)
	if BodyGyro and BodyGyro.Parent then
		local Direction = Pie.Velocity.unit
		BodyGyro.maxTorque = Vector3.new(1e4, 1e4, 1e4)
		BodyGyro.cframe = CFrame.new(Vector3.new(0, 0, 0), -Direction)
	end
end

wait(2)

if PieWeld and PieWeld.Parent then
	PieWeld:Destroy()
end

wait(8)

Debris:AddItem(Pie, 0)
