So, I want that "findSmoke" find all part named "SmokePart" and return all it to NPC_Module.Smoke but this return juste one part, why and how to correctly fix this? Thank for answers and the explanations:)
function findSmoke(character)
for _, v in pairs(character:GetChildren()) do
if v:IsA('Part') and v.Name == 'SmokePart' then
return v
end
end
end
function NPC_Module.Smoke(humanoid, character)
local smoke = findSmoke(character)
if humanoid.Health < 40 then
smoke.ParticleEmitter.Enabled = true
elseif humanoid.Health >= 40 then
smoke.ParticleEmitter.Enabled = false
end
end
