I have a game I'm working on and am trying to make it so upon death, the sound is random. Here's what I have so far:
function Died(p)
wait(.001)
local tracks=game.ServerStorage:GetChildren()
local rn=math.random(1,#tracks)
local track=tracks[rn]
track:Play()
Anyone have any idea as to why it's not working? It's a local script in the workspace.

1 comment
I've moved all the sounds into a folder and put the folder into StarterPlayerScripts so it's in the actual player. I then made it so the script paths to the sounds folder in the player, selects a random sound, and plays it. But still, nothing happens.