The title explains everything, the folder clones in the torso, and not the children inside the folder. Can anyone help?
local repstorage = game:GetService("ReplicatedStorage")
local eventfolder = repstorage:WaitForChild("RemoteEvents")
local chargeevent = eventfolder:WaitForChild("Charge")
local particlefolder = repstorage:WaitForChild("ChargeParticles")
local normalcharge = particlefolder:GetChildren()
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://2405207143"
local chargeend = eventfolder:WaitForChild("ChargeEnd")
chargeevent.OnServerEvent:Connect(function(player)
local animation1 = player.Character.Humanoid:LoadAnimation(animation)
animation1:Play()
for _, v in pairs(normalcharge) do
v:Clone().Parent = player.Character:WaitForChild("UpperTorso")
end
chargeend.OnServerEvent:Connect(function(player)
local chargeinplayer = player.Character.UpperTorso:GetChildren()
animation1:Stop()
for _, v in pairs(chargeinplayer) do
if v.Name == "NormalCharge" then
v:Remove()
end
end
end)
end)

7 comments
this might not fix it but use a variable for the clone and set the parent on a separate line
what im trying to do is clone the children inside the folder and only the children in the folder not the folder itself, but what i forgot to add in the title, it clones the folder and the children, and clones the entire folder including the children, which is the particles, and what im trying to do is clone the children not the folder and the children
Then you need clone each child separately, you can use the GetChildren function to get a table of them.
all you need is a statement like if not v:IsA("Folder") then v:Clone()
i figured it out, i forgot i had two folders named, charge particles and normal charge, and line 5 was getting the children for charge particles, and the only child of that was normal charge, which is a folder
hey, easy fix... why read all those unhelpful comments... use GetDescendants() instead of GetChildren()
when your "easy fix" isn't related to the problem at all