I have multiple Auras connected to a rig but I don’t know how to make a aura toggle that can detect which aura is being used so they can disable the aura? how do I do this? Also re enable the aura on the click of the button
You can use something like:
Model:GetDescendants()
(I might‘ve typed the void wrong)
which returns a table which you can then do a for i loop which sorts them out
local UnsortedTable = {} -- list of objects
local SortedTable = {} -- empty at first.
for i = 1, #UnsortedTable do
if UnsortedTable[i].Name == “Aura“ then
table.insert(SortedTable, UnsortedTable[i])
end
end
The auras have like 3 or 5 different emmiters to them on each form
the :GetDescendants() gets every part even parts that are parented to a part inside the model and puts them in a table
so the script you want kinda looks like this
local WeaponModelStuff = Model:GetDescendants() -- calls every single part in the model into a Table
local Auras = {} -- this fills up with auras later on
for i = 1, #WeaponModelStuff do
if WeaponModelStuff[i].Name == "Aura" then -- checks if the the object has the name "Aura"
table.insert(Auras, WeaponModelStuff[i]) -- This will put the emmiter in a Table.
end
end
This will find the Auras and put them in a table for use later
you can call the sorted Table with all emmiters with another for i loop.
so for example use a for i loop to stop emmiting or straight up delete the emmiter when the player presses a button.
Is their a way to re enable to the exact emitter that was disabled?
set that one value it has to true
The thing is will this work on Multiple Rigs because you step on the morph you want will it work for them all?
Well if the rig is going to be in the character, you could doing :GetDescendants() on the character which will look through everything inside it so yeah, it will just got to specify where it searches