Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why do all the models parts go inside each other?

So basically you become a non-character model. But all the parts weld into each other, why and how do i stop this?

local deb = false 
script.Parent.Touched:connect(function(hit)
	if deb == false then
		deb = true
		if hit.Parent:FindFirstChild("Humanoid") then
			for i, prt in pairs(hit.Parent:GetChildren()) do -- Hats
				if prt:IsA("Hat") then
					prt.Handle.Transparency = 1
				elseif prt:IsA("Part") then
					prt.Transparency = 1
				end
				local cactus = script.Parent.Parent.Cactus:Clone()
				cactus.Parent = hit.Parent
				cactus:SetPrimaryPartCFrame(hit.Parent.Torso.CFrame)
					for i, piece in pairs(cactus:GetChildren()) do
						local weld = Instance.new("Weld",piece)
						weld.Part0 = piece
						weld.Part1 = hit.Parent.Torso
					piece.Anchored = false
				end
			end			
		end
	end
	deb = false
end)

1 answer

The reason for this, is not purposing a position for each parts, if you look on line 16, you're setting each piece a weld, and each piece is being placed on weld.Part0 = piece. Obviously you would expect a little of an unwanted scenario. An easier way, is unioning all the elements, weld the union to the head/torso, then Position the union to the way you want it to be.

This discussion is preserved as it was. New answers, comments, and votes are closed.