nevermind that, does firstHit and finalHit parts have particles?
they do, the particles are inside some attachments
also, in the first hit my original code isnt a problem because there arent that many particles, but for the finalHit there are a lot so it ruins the effect
but have you tried enabling them outside the script? do the particles even work?
yes, iâve tried enabling them in and out of the script (they do work) i also searched to see if there was a way to detect if a particle was emitted but not really sure how that would help
Then thatâs why my loop doesnât work. Because index
is bigger than found
.
You could try just brute-forcing it and moving the first if statement from my method to second if statement, like this. Please excuse any mispells, I write this without autocomplete right in this devforum, I assume youâre smart enough to correct any.
local found = 0
for i,child in finalHit:GetDescendants() do
found +=1
if found == i then
if child:IsA("ParticleEmitter") then
child:Emit()
end
end
end
you wrote everything right, i dont see any mispells but it still doesnt show the particles, also, i made sure that the part IS in the right position AND in the workspance
Could you show us a screenshot of finalHit
âs hierarchy?
the name isnt the problem so dont worry about that
Oh my god. How long does that Attachment
chain go for? Could you show us the entire hierarchy of one attachment?
umm⌠here you go
i said that it had A LOT more particles i think
why donât you remove the task.wait()?
wouldnât that then emit all of the particles?
oh i think i know what youâre trying to do.
you can put a task.spawn()
task.spawn(function()
for i,v in attachment:GetDescendants()
task.wait()
v:Emit(v.Rate)
end
end)
ill try this tomorrow as its getting pretty late
I would try doing this instead:
While @TheJustTinOne was correct to use task.spawn, that would only spawn the loop, and it will still have the task.wait in-between.
for _, child in finalHit:GetDescendants() do
task.spawn(function()
if child:IsA('ParticleEmitter') then
child:Emit(child:GetAttribute('EmitCount')
end
end)
end
thx for that, i found the solution