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

How to split a part into peices?

I've been trying to do this for a while Basically it would convert the avatar from r6 to r12 and r15 to r30. The reason for this is realistic fire effect. I've looked at many code samples but I haven't figured it out. Heres my code

local function destroy(prt)
local prts = {}
for i=1,(prt.Size.Y)/0.5 do
	for i2=1,(prt.Size.X)/0.5 do
		for i3=1,(prt.Size.Z)/0.5 do
		local part = prt:Clone()
		if part:FindFirstChild("Sign") then
			part.Sign:Destroy()
		end
		if part:FindFirstChild("Needle") then
			part.Needle:Destroy()
		end
		part.Parent = game.Workspace
		part.Position = Vector3.new(((prt.Position.X - prt.Size.X/2)*(i2*0.5)),((prt.Position.Y - prt.Size.Y/2)*(i*0.5)),((prt.Position.Z - prt.Size.Z/2)*(i3*0.5)))
		--part.Parent = prt.Parent
		part.Size = Vector3.new(0.5,0.5,0.5)
		part.CanCollide = true
		part.Anchored = true
		table.insert(prts,part)
		end
	end
end
for i,v in pairs(prts) do
	v:BreakJoints()
	if i ~= 1 then
	--[[local weld = Instance.new("WeldConstraint")
	weld.Part0 = v
	weld.Part1 = prts[i-1]
	weld.Parent = v--]]
	end
	v.Anchored = true
end
prt:Destroy()
end 
wait(5)
char = game.Players.LocalPlayer.Character
for i,v in pairs(char:GetChildren()) do
	wait(5)
	if v:IsA("BasePart") and v.Name ~= "Head" and v.Name ~= "Torso" and v.Name ~= "HumanoidRootPart" then
		destroy(v)
	end
end

thanks in advance

2 answers

umm... it will be in multiple Part s but anyways:

--Lets say for example that there are 4 parts
local P1 = Instance.new("Part", workspace)
local P2 = Instance.new("Part", workspace)
local P3 = Instance.new("Part", workspace)
local P4 = Instance.new("Part", workspace)

P1.Position = Vector3.new(NumX,NumY,NumZ)
P2.Position = Vector3.new(NumX,NumY,NumZ)
P3.Position = Vector3.new(NumX,NumY,NumZ)
P4.Position = Vector3.new(NumX,NumY,NumZ)

2 comments

0

did you read the question?

0

You need to reword your question.

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