Advertisement
Guest User

[ROBLOX] Cherry/Ceirios' Sound Visualizer

a guest
Dec 12th, 2016
7,445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.61 KB | None | 0 0
  1. --[[
  2.  
  3. CEIRIOS' SOUND VISUALIZER
  4.  
  5. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  6. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  7. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  8. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  9. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  10. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  11. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  12. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  13. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  14. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  15.  
  16. CEIRIOS' SOUND VISUALIZER
  17.  
  18. There are several commands for this;
  19. Prefix - the symbol before saying a command, make sure it is 1 character long, the default is @.
  20. Color - the default color when the Rainbow command isn't active.
  21. Body - how high up or low the parts are from the HumanoidRootPart.
  22. Rainbow - depicts if the parts and pointlights are changing colors or not.
  23. Global - if the music is in the workspace or not.
  24. Angle - used to create shapes with the visualizer.
  25. Goal - [DON'T GO OVER 1 OR BELOW 0, IT'LL LAG THE GAME] how fast the parts reach their destination point.
  26. Split - another command to help create shapes with the visualizer.
  27. Parts - how many parts there're in the visualizer.
  28. Disp - how far away the parts are from the player.
  29. Power - how much the PlaybackLoudness is divided by. (depicts how long the parts get.)
  30. Material - the material of the parts.
  31. Play - changes the SoundId of the music, ex: Play 226205163
  32. Don't forget the Prefix before Play.
  33. Pause - pauses the sound.
  34. Resume - resumes the sound.
  35. Tpos - how far it is into the sound.
  36. MaxDis - how far the sound reaches in distance.
  37. Emit - how far before the sound starts getting quiet.
  38. Vol - how loud the sound is.
  39. Pitch - defines the pitch of the sound.
  40. Follow - changes who the parts follow.
  41. Whitelist - allows other people to use the commands above, including this one.
  42.  
  43. Made entirely by Ceirios.
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. DO NOT EDIT THE CODE BELOW, UNLESS YOU KNOW WHAT YOU'RE DOING, YOU'LL BREAK IT IF YOU MESS ANYTHING UP!
  54. DO NOT EDIT THE CODE BELOW, UNLESS YOU KNOW WHAT YOU'RE DOING, YOU'LL BREAK IT IF YOU MESS ANYTHING UP!
  55. DO NOT EDIT THE CODE BELOW, UNLESS YOU KNOW WHAT YOU'RE DOING, YOU'LL BREAK IT IF YOU MESS ANYTHING UP!
  56. DO NOT EDIT THE CODE BELOW, UNLESS YOU KNOW WHAT YOU'RE DOING, YOU'LL BREAK IT IF YOU MESS ANYTHING UP!
  57. DO NOT EDIT THE CODE BELOW, UNLESS YOU KNOW WHAT YOU'RE DOING, YOU'LL BREAK IT IF YOU MESS ANYTHING UP!
  58. DO NOT EDIT THE CODE BELOW, UNLESS YOU KNOW WHAT YOU'RE DOING, YOU'LL BREAK IT IF YOU MESS ANYTHING UP!
  59. DO NOT EDIT THE CODE BELOW, UNLESS YOU KNOW WHAT YOU'RE DOING, YOU'LL BREAK IT IF YOU MESS ANYTHING UP!
  60. DO NOT EDIT THE CODE BELOW, UNLESS YOU KNOW WHAT YOU'RE DOING, YOU'LL BREAK IT IF YOU MESS ANYTHING UP!
  61.  
  62. ]]--
  63.  
  64. local Follow='LocalPlayer'
  65. local Plr=game.Players[Follow]
  66. local Char=Plr.Character
  67. local RootPart=Char.HumanoidRootPart
  68.  
  69. local Parts=Instance.new('Model')
  70. Parts.Parent=Char
  71.  
  72. local Whitelist={}
  73.  
  74. Whitelist[Plr.Name]={Name=Plr.Name,UserId=Plr.UserId}
  75.  
  76. local Settings={
  77. Prefix='@',
  78. Color='Light blue',
  79. Body=-3,
  80. Rainbow=false,
  81. Global=false,
  82. Angle=24,
  83. Goal=.15,
  84. Split=2,
  85. Parts=0,
  86. Disposition=4,
  87. Power=450,
  88. Material='Neon',
  89. Colors={
  90. Color3.fromRGB(244,66,66),
  91. Color3.fromRGB(244,149,66),
  92. Color3.fromRGB(244,203,66),
  93. Color3.fromRGB(83,244,66),
  94. Color3.fromRGB(66,244,212),
  95. Color3.fromRGB(66,152,244),
  96. Color3.fromRGB(107,66,244),
  97. Color3.fromRGB(229,66,244)
  98. }
  99. }
  100.  
  101. function Sound(Name,Looped,Pitch,Volume,ID,Parent)
  102. local Snd=Instance.new('Sound')
  103. Snd.Name=Name
  104. Snd.SoundId='rbxassetid://'..ID
  105. Snd.Looped=Looped
  106. Snd.PlaybackSpeed=Pitch
  107. Snd.Volume=Volume
  108. Snd.EmitterSize=10
  109. Snd.MaxDistance=100
  110. Snd.Parent=Parent
  111.  
  112. return Snd
  113. end
  114.  
  115. local Music=Sound('Music',true,1,1,0,RootPart)
  116.  
  117. function Part(Num)
  118. Settings.Parts=Num
  119.  
  120. for i,v in pairs(Parts:GetChildren()) do
  121. v:Destroy()
  122. end
  123.  
  124. for i=1,Num do
  125. local P=Instance.new('Part')
  126. local Light=Instance.new('PointLight')
  127. Light.Brightness=10
  128. Light.Range=10
  129. Light.Parent=P
  130. P.BrickColor=BrickColor.new(Settings.Color)
  131. P.Transparency=0
  132. P.Anchored=true
  133. P.CanCollide=false
  134. P.Material=Settings.Material
  135. P.Size=Vector3.new(.2,.2,.2)
  136. P.CFrame=CFrame.new(RootPart.CFrame.X,RootPart.CFrame.Y+Settings.Body,RootPart.CFrame.Z)
  137. P.Locked=true
  138. P.Parent=Parts
  139. end
  140. end
  141.  
  142. Part(31)
  143.  
  144. function ColorChange()
  145. while game:GetService'RunService'.RenderStepped:wait() do
  146. local Color=Settings.Colors[math.random(1,#Settings.Colors)]
  147. for i,v in pairs(Parts:GetChildren()) do
  148. v.Material=Settings.Material
  149. if Settings.Rainbow==false then
  150. v.BrickColor=BrickColor.new(Settings.Color)
  151. v.PointLight.Color=Color3.fromRGB(255,255,255)
  152. else
  153. v.BrickColor=BrickColor.new(Color)
  154. v.PointLight.Color=Color
  155. end
  156. end
  157. end
  158. end
  159.  
  160. local Rad=0
  161.  
  162. function Rot()
  163. while game:GetService'RunService'.RenderStepped:wait() do
  164. Rad=Rad+1
  165.  
  166. if Rad>=360 then
  167. Rad=0
  168. end
  169.  
  170. for i,v in pairs(Parts:GetChildren()) do
  171. v.CFrame=v.CFrame:Lerp(CFrame.new(RootPart.CFrame.X,RootPart.CFrame.Y+Settings.Body,RootPart.CFrame.Z)*CFrame.Angles(0,math.rad((360/Settings.Parts)*((i+(i*Settings.Angle))/Settings.Split)+Rad),0)*CFrame.new(0,0,Settings.Disposition+(v.Size.Z)),Settings.Goal)
  172. end
  173. end
  174. end
  175.  
  176. function Size()
  177. while game:GetService'RunService'.RenderStepped:wait() do
  178. for i,v in pairs(Parts:GetChildren()) do
  179. v.Size=v.Size:Lerp(Vector3.new(.2,.2,(Music.PlaybackLoudness/Settings.Power)*math.random(4,8)),Settings.Goal)
  180. end
  181. end
  182. end
  183.  
  184. spawn(Rot)
  185. spawn(Size)
  186. spawn(ColorChange)
  187.  
  188. function Chatted(Speaker,Message)
  189. for i,v in pairs(Whitelist) do
  190. if v.Name==Speaker.Name or v.UserId==Speaker.UserId then
  191. if Message:sub(1,6):lower():match(Settings.Prefix..'play ') then
  192. Music.SoundId='rbxassetid://'..Message:sub(7)
  193. Music:Play()
  194. elseif Message:sub(1,6):lower():match(Settings.Prefix..'pause') then
  195. Music:Pause()
  196. elseif Message:sub(1,7):lower():match(Settings.Prefix..'resume') then
  197. Music:Resume()
  198. elseif Message:sub(1,6):lower():match(Settings.Prefix..'tpos ') then
  199. Music.TimePosition=tonumber(Message:sub(7))
  200. elseif Message:sub(1,6):lower():match(Settings.Prefix..'emit ') then
  201. Music.EmitterSize=tonumber(Message:sub(7))
  202. elseif Message:sub(1,5):lower():match(Settings.Prefix..'vol ') then
  203. Music.Volume=tonumber(Message:sub(6))
  204. elseif Message:sub(1,7):lower():match(Settings.Prefix..'pitch ') then
  205. Music.PlaybackSpeed=tonumber(Message:sub(8))
  206. elseif Message:sub(1,8):lower():match(Settings.Prefix..'maxdis ') then
  207. Music.MaxDistance=tonumber(Message:sub(9))
  208. elseif Message:sub(1,8):lower():match(Settings.Prefix..'prefix ') then
  209. Settings.Prefix=Message:sub(9)
  210. elseif Message:sub(1,7):lower():match(Settings.Prefix..'angle ') then
  211. Settings.Angle=tonumber(Message:sub(8))
  212. elseif Message:sub(1,7):lower():match(Settings.Prefix..'split ') then
  213. Settings.Split=tonumber(Message:sub(8))
  214. elseif Message:sub(1,6):lower():match(Settings.Prefix..'goal ') then
  215. Settings.Goal=tonumber(Message:sub(7))
  216. elseif Message:sub(1,7):lower():match(Settings.Prefix..'color ') then
  217. Settings.Color=Message:sub(8)
  218. elseif Message:sub(1,6):lower():match(Settings.Prefix..'body ') then
  219. Settings.Body=tonumber(Message:sub(7))
  220. elseif Message:sub(1,10):lower():match(Settings.Prefix..'material ') then
  221. Settings.Material=Message:sub(11)
  222. elseif Message:sub(1,7):lower():match(Settings.Prefix..'global') then
  223. if Settings.Global==false then
  224. Settings.Global=true
  225. Music.Parent=workspace
  226. else
  227. Settings.Global=false
  228. Music.Parent=RootPart
  229. end
  230. elseif Message:sub(1,6):lower():match(Settings.Prefix..'disp ') then
  231. Settings.Disposition=tonumber(Message:sub(7))
  232. elseif Message:sub(1,7):lower():match(Settings.Prefix..'parts ') then
  233. Part(tonumber(Message:sub(8)))
  234. elseif Message:sub(1,7):lower():match(Settings.Prefix..'power ') then
  235. Settings.Power=tonumber(Message:sub(8))
  236. elseif Message:sub(1,8):lower():match(Settings.Prefix..'follow ') then
  237. for i,v in pairs(game.Players:GetPlayers()) do
  238. if v.Name:lower():match(Message:sub(9):lower()) then
  239. Follow=v.Name
  240. Plr=game.Players[Follow]
  241. Char=Plr.Character
  242. RootPart=Char.HumanoidRootPart
  243. if Settings.Global==false then
  244. Music.Parent=RootPart
  245. end
  246. end
  247. end
  248. elseif Message:sub(1,11):lower():match(Settings.Prefix..'whitelist ') then
  249. for i,v in pairs(game.Players:GetPlayers()) do
  250. if v.Name:lower():match(Message:sub(12):lower()) then
  251. Whitelist[v.Name]={Name=v.Name,UserId=v.UserId}
  252. end
  253. end
  254. elseif Message:sub(1,8):lower():match(Settings.Prefix..'rainbow') then
  255. if Settings.Rainbow==false then
  256. Settings.Rainbow=true
  257. else
  258. Settings.Rainbow=false
  259. end
  260. end
  261. end
  262. end
  263. end
  264.  
  265. game.Players.PlayerAdded:connect(function(Plyr)
  266. Plyr.Chatted:connect(function(Message) Chatted(Plyr,Message) end)
  267. end)
  268.  
  269. for i,v in pairs(game.Players:GetPlayers()) do
  270. v.Chatted:connect(function(Message) Chatted(v,Message) end)
  271. end
  272.  
  273. --[[
  274.  
  275. CEIRIOS' SOUND VISUALIZER
  276.  
  277. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  278. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  279. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  280. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  281. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  282. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  283. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  284. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  285. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  286. READ THE ENTIRE COMMENT SECTION TO LEARN HOW TO USE!
  287.  
  288. CEIRIOS' SOUND VISUALIZER
  289.  
  290. There are several commands for this;
  291. Prefix - the symbol before saying a command, make sure it is 1 character long, the default is @.
  292. Color - the default color when the Rainbow command isn't active.
  293. Body - how high up or low the parts are from the HumanoidRootPart.
  294. Rainbow - depicts if the parts and pointlights are changing colors or not.
  295. Global - if the music is in the workspace or not.
  296. Angle - used to create shapes with the visualizer.
  297. Goal - [DON'T GO OVER 1 OR BELOW 0, IT'LL LAG THE GAME] how fast the parts reach their destination point.
  298. Split - another command to help create shapes with the visualizer.
  299. Parts - how many parts there're in the visualizer.
  300. Disp - how far away the parts are from the player.
  301. Power - how much the PlaybackLoudness is divided by. (depicts how long the parts get.)
  302. Material - the material of the parts.
  303. Play - changes the SoundId of the music, ex: Play 226205163
  304. Don't forget the Prefix before Play.
  305. Pause - pauses the sound.
  306. Resume - resumes the sound.
  307. Tpos - how far it is into the sound.
  308. MaxDis - how far the sound reaches in distance.
  309. Emit - how far before the sound starts getting quiet.
  310. Vol - how loud the sound is.
  311. Pitch - defines the pitch of the sound.
  312. Follow - changes who the parts follow.
  313. Whitelist - allows other people to use the commands above, including this one.
  314.  
  315. Made entirely by Ceirios.
  316.  
  317. ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement