Hey, so I am trying to make this code emit a random sound from a part. I also want it to play another sound after the other is done playing. These sounds are children of the part. I wrote this script but it's not playing the sound, I guess it sees 'randomItem' as a number.
local items = script.Parent:GetChildren()
for _, v in ipairs(script.Parent:GetChildren()) do
if v.ClassName == "Sound" then
v:GetChildren(items)
local randomItem = math.random(#items)
print(#items)
randomItem.Playing = true
end
end
Are there any other methods of doing this better? Please let me know if there are, thanks!

1 comment
Thank you! There is still one problem though, it plays all of the sounds at once, do you know how that can be fixed? If not, that's alright.