Making a "The Infection" type game and I'm trying to make it so it plays a random audio everytime humans/zombies win. But when I try, the timer stops and nothing happens. What's wrong in this?
function PickRandomFrom(tab)
return tab[math.random(1,#tab)]
end
local id = PickRandomFrom(225032784,225032798,225032815)
local WinMusic = Instance.new("Sound", Game.Workspace)
WinMusic.SoundId = "http://www.roblox.com/asset?id=" ..id.. ""
WinMusic:Play()
wait(15)
WinMusic:Remove()

2 comments
Works, thank you!
You're welcome !