So basically I have a folder with models, inside those models there’s emitters. So I want to randomly select a few of those emitters and enable them for a few seconds and then disable them and enable others and so on. How would I go about this?
First add the names of the models to a table.
Local models = {“model1”,”model2”}
Pick a random model.
Local selection = models[math.random(1,#models)]
The go through the path to the emitter and enable it.
game.Folder.selection.emitter.enabled = true
wait(5)
game.Folder.selection.emitter.enabled = false
try this
local modelsFolder = --REFERENCE THE FOLDER HERE
local amountToEnable = 5
for i = 1, amountToEnable, 1 do
local models = modelsFolder:GetChildren()
local randomModel = models[math.random(1, #models)]
randomModel.Emitter.Enabled = true
wait(5)
randomModel.Emitter.Enabled = false
end