The Bottom cloning code is glitched The labeled part wont clone the pants into the Character Please help THX for reading!

wait(5)
target = Vector3.new(42, 0.5, -27)
target2 = Vector3.new(34, 0.5, -27)
while game.Players.NumPlayers < 1 do
	     wait()
  end
 local Players = game.Players:GetPlayers()
	for i,v in pairs(Players) do
  v.Character.Torso.CFrame = CFrame.new(target2)
end

wait(5)

	while game.Players.NumPlayers < 1 do
		wait()
	end 
local Players = game.Players:GetPlayers()
  local Phantom = Players[math.random(#Players)]
	target = Vector3.new(42, 0.5, -27)
Phantom.Character.Torso.CFrame = CFrame.new(target)
PhantomHead = Phantom.Character.Head
for i, v in pairs(Phantom.Character:GetChildren()) do
	 if v:IsA("Hat") then
	v:Destroy()
end
wait()
end
--Broken Section Here
local Kit = game.workspace._PhantomKit
local PhantomHat = Kit.PhantomBody.Hat
local PhantomMesh = PhantomHat.Mesh
local PhantomPants = Kit.PhantomBody.Pants
PhantomPants:Clone(Phantom.Character) -- Wont clone into the Phantoms character
Mesh = Instance.new("SpecialMesh")
PhantomHead.Mesh:Remove()
Mesh.MeshId = PhantomMesh.MeshId
Mesh.TextureId = PhantomMesh.TextureId
Mesh.Parent = PhantomHead

3 comments

0

A while loop prevents the code from continuing. Even if it returns false, it'll keep attempting no matter what.

0

That is completely incorrect: while false do end print("See?")

0

@ioutrageous; what about the cloning is broken? Without a bit more explanation we can't really help you.