Clone a Particle to every Part in a model

local tower = game.Workspace._WSAamTum.Tower
local model = tower:FindFirstChild("Model")
local Particle_Here= script.Particle_Here

for _, part in pairs(model:GetDescendants()) do
	if part:IsA("Part") then
		local gui = Particle_Here:Clone()
		gui.Parent = part
	end
end
wait(400) --- wait 8 menutes before running it again

image
so I want to make a particle clone to all the parts that are like in the picture, with a duration of 8 minutes once before cloning again.

but the script that I made and put in the serverscriptservice is not working, can anyone help me?

1 Like

Could you please elaborate on what you’re trying to achieve?
I’m a little confused, the script you show is about a surface GUI and you want a particle clone? Also you want the particle to keep cloning or did you mean you want it to be enabled / disabled?

2 Likes

sorry for the confusion I meant for particle emitters.

keep the particle and cloning it again every 8 minutes

Why do you want to clone it? Are you trying to get the particle emitter inside each part?

1 Like

You should do model:GetChildren() as you are a looping through all the “Particle Here”s when you use getdescendants(). Thus, the if statement is never true as the “particle here”is not a part

1 Like

Yes, after I clone it, I will parent it to every part in the model.

It seems your script already does that, are you trying to find a way to make it repeat every 8 minutes?

1 Like
while true do
	for _, part in pairs(model:GetDescendants()) do
		if part:IsA("Part") then
			local gui = Particle_Here:Clone()
			gui.Parent = part
		end
	end
	wait(400)
end
1 Like

Okay this use case seems kinda crazy, adding a bunch of new particles every 8 minutes, presumably without deleting them ever
Whats the actual goal here so we can provide a better method?

2 Likes

What I mean is, I want the particles to spawn into all models even if the model is inside the model, so even inside the model, the particles can be cloned.

Yes, this can be achieved with @OfficialModaX 's code

but I meant why are you trying to add so many particles?

After like 5 hours of the server being up the performance would start to go down severly from all the particles so whats the actual goal
Are you trying to make a building be lit on fire or something?
How long would the particles be there before despawning?
Do you even intend for them to despawn?

also as for this question
is the particle inside the script or by not working do you mean they dont despawn

1 Like

so what I want to achieve is that the script.particle located in the serverscriptservice will clone to all parts located in the workspace, but I want to make it not only clone the first model but also clone the parts in the model of the model.

so even if the part’s parent is a model and the model then the part of all the model’s children will be cloned by the particle emitter.

so my achieve is particle that has been cloned will be destroyed by another script so don’t worry about lag, I just want to make script.Particle clone to all children of the model (even tho the model has model)

local tower = workspace._WSAamTum.Tower
local model = tower:FindFirstChildWhichIsA("Model")
local Particle_Here= script:FindFirstChildWhichIsA("ParticleEmitter") -- wont work properly if you have 2 different particles

local CD = 480 -- 8 minutes

task.spawn(function() -- just added encase the script continues past the loop
	while true do
		for i,v in model:GetDescendants do
			if v:IsA("BasePart") or v:IsA("MeshPart") then -- basepart includes unions and parts
				local clone = Particle_Here:Clone()
				clone.Parent = v
			end
		end
		task.wait(CD)
	end
end)
1 Like