I have a model with multiple parts inside it with the same name and I am trying to use a single script to execute it. Is it possible to set the multiple parts to a single variable so I can run it easier? The code I attached is the audio part of the script. Model = Light3, Part = Bulb, Bulb contains the sound (BuzzingLight).
audioT = {} for _, v in ipairs(workspace.Light3:GetDescendants()) do if v == "BuzzingLight" then table.insert(audioT, v) print(audioT) end end audioT.Volume = 0
If you want to reduce the volume of sound you can do
for _, v in ipairs(workspace.Light3:GetDescendants()) do if v.Name == "BuzzingLight" then v.Volume = 0 end end
And if you want to access it later you can do
for _, v in ipairs(workspace.Light3:GetDescendants()) do if v.Name == "BuzzingLight" then -- do stuff to the BuzzingLight end end