Advertisement
itchyzombie

rblx rhcp player

Sep 3rd, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. local audios=[[Californication:275607744
  2. Can't/Cant Stop:155199230
  3. Dani California:161606686
  4. Otherside:163548096
  5. Around The World:281851774
  6. Scar Tissue:165147575
  7. Snow (Hey Oh):158362020
  8. The Adventures Of Raindance Maggie:237640582
  9. Higher Ground:259286286
  10. A Moment Of Violence:272199863
  11. The Zephyr Song:281850560
  12. Dosed:241781830
  13. Torture Me:302646944
  14. ]]
  15. --last one is streetlight manifesto
  16. audios=audios:lower();
  17. at={}
  18. for match in audios:gmatch(".-:%d+") do
  19. local name, id = match:match("([^:]+):(%d+)")
  20. print(name, id)
  21. table.insert(at, {name=name; id=id})
  22. end
  23. function play(id, volume, name)
  24. local a=Instance.new("Sound", workspace)
  25. a.SoundId="rbxassetid://"..id;
  26. a.PlayOnRemove=true
  27. a.Volume=volume and volume or 1
  28. a:Destroy()
  29. print("play", name and name or id, "id", id)
  30. end
  31. owner.Chatted:connect(function(msg)
  32. msg=msg:lower()
  33. if msg:lower():sub(1, 4)=="play" then
  34.  
  35. local found=false
  36. for _, audio in ipairs(at) do
  37. if audio.name:find(msg:sub(6, -1)) then
  38. play(audio.id, 1, audio.name)
  39. found=true;
  40. break;
  41. end
  42. end
  43. if not found then
  44. if msg:sub(6, -1):match("%d+") then
  45. play(msg:sub(6, -1))
  46. end
  47. end
  48. end
  49. end)
  50.  
  51. for _, audio in ipairs(at) do
  52. play(audio.id, 0, "") --preload audio
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement