None of this is red
Outputs not saying anything is wrong
Its just not working
workspace.Music.Music:GetChildren().Volume = 0
Music is a folder and I'm trying to change all of the audios inside of it to the volume 0 But its just not working
Any ideas as to why its not working?
:GetChildren()
is a function used to get the children of an instance and returns it as an array. Since this gives you an array, you could use a generic for-loop to iterate through every child/value in the array.
local MusicFolder = workspace.Music --Gets the folder of music for _, song in ipairs(MusicFolder:GetChildren()) do if song:IsA("Sound") then song.Volume = 0 end end
In the above code, we define our Music folder then get it's children in the loop. The 'song' variable will be the child or value in the array. We then set it's Volume if it's a Sound object.
If I missed anything or you need anything explained let me know.