Hey, I have this fire system for my game and I would like to see if each particle model is enabled.
Here is my workspace so basicly when each firepart is not enabled it will run the next part of actions. Is there a possible way to see if each one is disabled?
Not sure if this is the best way to do this but here is what came to my mind first.
Loop through all FireParticles in that Model and count them.
local MaxFire = 4 --The Amount of FireParticles you have
local CurrentFire = 0 --The Amount that is Active (Don't change)
local FireParts = script.Parent --Get the FireParts Folder
for i,v in pairs(FireParts:GetDescendants()) do --Loops through everything inside of FireParts. The letter "v" stands for the current part/object in the loop
if v:IsA("ParticleEmitter") then --Checks if the current object is a ParticleEmitter
v.Changed:Connect(function() --Fires the script/code below whenever something in the ParticleEmitter changes
if v.Enabled == true then --Checks if the Fire is on
CurrentFire = CurrentFire + 1 --Adds one point to the CurrentFire Value
else
CurrentFire = CurrentFire - 1 --Removes one point from the CurrentFire Value
end
if CurrentFire == MaxFire then --Checks if CurrentFire has the same Value as MaxFire which means that everything is enabled
--*Your Code Here*
end
end)
end
end
Ok, I want to tell when they are off so would I change v.Enabled == true
to v.Enabled == false