Somebody was trying to help me randomize custom death sounds and gave me this script.
IDs = {130965811, 131045862, 131045876} game.Players.PlayerAdded:connect(function(player) repeat wait() until player.Character player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function(human) sound = "http://www.roblox.com/asset/?id="..tostring(IDs[math.random(#IDs)]) sound:Play() end) end) end)
However, it doesn't work. Is there a way to salvage this?
Change (IDs[math.random(#IDs)])
to (IDs[math.random(1,#IDs)])
I'm pretty sure you must give math.random() a number to start with, as well as end with.