I have a script that gets all descendance of a model and checks if it’s something, do this. Specifically, if it’s a particle emitter, add it to a table, and for each particle emitter in the table, Emit 4 particles 5 times. Thing is, it only emits out of 1 of the particles, and just pretends the other one doesn’t exist.
Script:
module.AnimatePressurePlateOn1 = function(ins:Model) -- Pretend the "ins" is "Pillar1" as seen in the video from the Explorer
local tweenOn = {}
local particleEmitters = {}
local num = 0
for _,obj in ins:GetDescendants() do
if obj:IsA("Part") or obj:IsA("UnionOperation") then
local tween = tweenService:Create(obj,module.infoSaves.info4,
{
Transparency = 0,
CanCollide = true
})
table.insert(tweenOn,tween)
continue
end
if obj:IsA("ParticleEmitter") then
table.insert(particleEmitters,obj)
end
end
for _,tween in tweenOn do
tween:Play()
end
for _,particle in particleEmitters do
while num < 5 do
particle:Emit(4)
num+=1
end
end
end
Video:
Things I’ve done
- Check it it’s actually part of the table, i.e.
for _,particle in particleEmitters do
print(particle)
while num < 5 do
particle:Emit(4)
num+=1
end
end
yes, I have, it prints 2 things, so I know damn well it’s in there.
- Use
task.spawn()
i.e.
for _,particle in particleEmitters do
task.spawn(function()
while num < 5 do
particle:Emit(4)
num+=1
end
end)
end
yes, I have, still same problem still happens.
- Changing the name one of the emitters, yes, same problem happens
In short, the script is detecting both emitters, but refuses to acknowledge one of them for no reason, at least for what I can think of. Stupidest part yet, I made a similar set up in a different script, AND IT WORKS, WTF AM DOING WRONG HERE THEN>???