Its_YeBoi

Very Special One

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