How to move all content from a folder to another place?

Hey, im making a rng game, and i need to move all the content from my vfx folder, to the HumanoidRootPart
Anything i could do?

(Here is my code)

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local button = script.Parent
local gui = button.Parent	
local auraFolder = game:GetService("ReplicatedStorage"):WaitForChild("AurasT")
local auras = auraFolder:GetChildren()
local vfxfolder = game:GetService("ReplicatedStorage"):WaitForChild("AuraVfx")
local rollText = gui.AuraLabel
local playerInv = Instance.new("Folder")
playerInv.Parent = game.Players.LocalPlayer
playerInv.Name = "playerinv"

button.MouseButton1Click:Connect(function()
	local aura = auras[math.random(1, #auras)]
	for i=1, #auras do
		wait(.1)
		local randomAura = auras[math.random(1, #auras)]
		rollText.Text = randomAura.Name	
	end
	wait(.1)
	rollText.Text = aura.Name
	print(aura.Name)
	local gottenaura = aura:Clone()
	gottenaura.Parent = playerInv
	local auraVfx = vfxfolder:WaitForChild(gottenaura.Name, 3)
	if auraVfx then
		local vfx = auraVfx:WaitForChild("Vfx")
		local particles = auraVfx:WaitForChild("Particles")
		local text = auraVfx:WaitForChild("Text")
		local partcont = particles:GetChildren()
		local textcont = text:GetChildren()
		local vfxcont = vfx:GetChildren()
		for i=1,#partcont do
			for i2,v in pairs(partcont) do
				if v:IsA("ParticleEmitter") then
					local newAtt = Instance.new("Attachment")
					newAtt.Name = v.Name
					newAtt.Parent = hrp
					v.Parent = newAtt
				end	
			end			
		end
		for i,v in pairs(textcont) do
			if v:IsA("BillboardGui") then
				v.Parent = char.Head
			end
		end
		print(vfxcont.Parent)
	end
end)

in the print(vfxcont.Parent) line, i got nil in my console, so that didn’t work…

So you want to parent all the stuff in the vfx folder into the rootPart?
Just make a for loop to loop through all the children, then clone the thing and parent it to the root

i didnt understand, can you give me a code sample?

for _, child in pairs(vfxFolder:GetChildren()) do
     child:Clone().Parent = hrp
end

Something like that

Ok yeah probably go learn about the basics.

or yeah what @Rinpix said

ik the basics but my 3iq doesnt let me get it lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.