It's part of a script that is in a sound glitch fix script. I wanting to know if I could use the mathrandom function to play a different song. And the random sound would allow for the same sound to play twice before switching to the other. There is only two sounds as well.
local sJumping = newSound("http://www.roblox.com/asset/?ID=155499501")
well i can see that newsound(id) is a function from a separate script.
however, what I would so on the other hand would be to create a table of IDs, then set up a loop to play them in sequence.
asset = "http://www.roblox.com/asset/?ID=" IDs = {155499501,1337,1234567890} -- add more sounds here, separate by a coma. counter = 1 local sound = Instance.new("Sound",workspace) while true do wait() sound.SoundId = asset..""..IDs[counter] sound:play() if counter < #IDs then counter = counter + 1 else counter = 1 end end
This essentially cycles through a tab, or playlist, of songs.