Advertisement
tripono

Base of sound visulizer

Jul 29th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. player = game.Players.LocalPlayer
  2.  
  3. local snd = Instance.new "Sound"
  4. snd.Parent = "" --Put main part here
  5. snd.Volume = 1
  6.  
  7. --Commands
  8. player.Chatted:connect(function(chatmessage)
  9. local soundid = chatmessage:match("'play (%d+)")
  10. local volume = chatmessage:match("'vol (%d+)")
  11. local speed = chatmessage:match("'spd (%d+)")
  12. local loopon = chatmessage:match("'loopon")
  13. local loopoff = chatmessage:match("'loopoff")
  14. local stop = chatmessage:match("'stop")
  15. local pause = chatmessage:match("'pause")
  16. local play = chatmessage:match("'play")
  17. if volume then
  18. snd.Volume = volume
  19. end
  20. if soundid then
  21. snd:Stop()
  22. snd.SoundId = "rbxassetid://845004586"
  23. snd:Play()
  24. end
  25. if speed then
  26. snd.Pitch = speed
  27. end
  28. if loopon then
  29. snd.Looped = true
  30. end
  31. if loopoff then
  32. snd.Looped = false
  33. end
  34. if stop then
  35. snd:Stop()
  36. end
  37. if pause then
  38. snd:Pause()
  39. end
  40. if play then
  41. snd:Play()
  42. end
  43. end)
  44.  
  45. --Plug in things here to be controlled by PlaybackLoudness
  46. while game:GetService("RunService").RenderStepped:wait() do
  47. local l = snd.PlaybackLoudness
  48.  
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement