Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I'm trying to get a random death sound, and this won't work. Could you help?

Here is the original script:

wait(.05)
local musicids={1238804383,513492655,138050836} 
function PickRandomFrom(tab)
return tab[math.random(1,#tab)]
end
local id=PickRandomFrom(musicids)
script.Parent.Head.Died=Instance.new("Sound",game.Workspace)
script.Parent.Head.Died.SoundId = id else

If you help, that will be greatly appreciated!

1 answer

✓ Accepted answer

I gotchu fam

wait(.05)
local musicids={1238804383,513492655,138050836} 
function PickRandomFrom(tab)
return "rbxassetid://"..tostring(tab[math.random(1,#tab)])
end
local id=PickRandomFrom(musicids)
script.Parent.Head:WaitForChild("Died").SoundId = id

This discussion is preserved as it was. New answers, comments, and votes are closed.