I am working on a game where the main menu has flames coming from the back, but the amount of parts with flames are too many for me to just make a variable for each and every fire.
How would I make a variable that can go through every part and select every fire into one variable to change the property in one go, or a way to change a properties without doing each individual fire.
local model_FireBackgroundEffect = script.Parent
for index_in_loop, fire in pairs(model_FireBackgroundEffect:GetDescendants()) do
if fire:IsA("Fire") then fire.Enabled = false end
end
This should work. Shall it not, we’ll help ya.
Remember, if you are placing a local script inside of model_FireBackgroundEffect, the local script will not run as local scripts only load in certain areas. In that case, place the script in StarterPlayerScripts and edit the location of the model_FireBackgroundEffect.