Ello! I want to a script that clones a group of parts that have particles in them to the workspace when a player touches it. I also want this to be in a client or a local server since I don’t want this to be for the server just for clients. I put the script in startplayerscripts and I tried to make the script but I couldn’t it keeps giving this error " Players.MGamer_Dev.PlayerScripts.WaterParticles:7: attempt to call a nil value"
WaterParticles is defined as the table returned by GetChildren. Clone is not a member of this table. Did you mean to clone the entire WaterParticles instance? If not and you wanted to clone each individual one, then you’d have to loop through the table and clone them.
for _, particle in ipairs(WaterParticles) do
particle:Clone().Parent = workspace
end
Well the particles is in a part and I have multiple of these parts so I grouped them and named them particles so when I did :GetChildren() I meant that it got the children and cloned them with the particles inside you know what I mean?
Refer to my previous post. The WaterParticles variable right now refers to a table comprised of the children of WaterParticles in ReplicatedStorage. You can’t call Clone here because the table does not have a Clone method in it, it’s just a list of instances.
You need to loop through the table and clone each individual item.
Refer to my previous posts, I’d like to think they do speak for themselves. GetChildren returns a simple array of an instance’s children. That table does not have any methods or properties. Only way you’re cloning them is with a loop or removing GetChildren from the WaterParticles variable.