I am making a script that would clone a ball and it’s effects (children) to the workspace.
NRGremoteEvent = game.ReplicatedStorage.nrgEvent NRGremoteEvent.OnServerEvent:Connect(function(plr) local NRGclone = game.ReplicatedStorage.NRGfolder.EnergyBmain:Clone() NRGclone.Parent = game.Workspace NRGclone.Position = Vector3.new(0,30,30) end)
The thing is, that it only clones the main (EnergyBmain). It doesn’t clone it’s children which are particles and such. They’re stored in a folder (NRGfolder) and is located inside ReplicatedStorage. I’m very lost on what to do, i can’t find a way to clone the whole thing (main and children), please help. Thanks.
(on mobile rn.)
NRGremoteEvent = game.ReplicatedStorage.nrgEvent NRGremoteEvent.OnServerEvent:Connect(function(plr) local NRG = game.ReplicatedStorage.NRGfolder.EnergyBmain:GetChildren() for i, v in pairs(NRG) do wait() local NRGclone = v:Clone() NRGclone.Parent = game.Workspace NRGclone.Position = Vector3.new(0,30,30) end end)
So what I did was I gathered the children, and cloned them one by one in a for in pairs()
loop.