sneakydodge123

of music

Dec 12th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- [FE] Simple Music Player
  2. LPlayer = game:GetService('Players').LocalPlayer
  3.  
  4. function PlaySound(id)
  5. local b = Instance.new('Sound', workspace)
  6. b.SoundId = 'rbxassetid://' .. id
  7. b:Play()
  8. repeat wait(1)
  9. until
  10. LPlayer.Chatted:Wait() == ":stop"
  11. b:Stop()
  12. b:Destroy()
  13. end
  14.  
  15. LPlayer.Chatted:connect(function(msg)
  16. if msg:sub(1,6) == ":find " then
  17. local b = game:HttpGet("https://search.roblox.com/catalog/json?SortType=Relevance&ResultsPerPage=1&Category=Audio&Keyword=" .. msg:sub(7) .. "/", true)
  18. local a = b:match('Id"+%S+,'):match('%d+')
  19. PlaySound(a)
  20. end
  21. end)
Add Comment
Please, Sign In to add comment