Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago

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
Ad

Answer this question