Advertisement
squidingtin

Audio Visualizer

Jan 19th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. edited by mr steal yo bork with a sweet gui
  3. credits goes to the original creators
  4. --]]
  5.  
  6. -- visualizer
  7. local Parts = {}
  8. local Parts2 = {}
  9. local Direction = 1
  10. local loudness = 0
  11. local TColor = BrickColor.new("Black")
  12. for i = 1, 100 do
  13. local p = Instance.new("Part", game.Players.LocalPlayer.Character.Torso)
  14. p.Size = Vector3.new(0.2, 0.2, 0.2)
  15. p.Anchored = true
  16. p.CanCollide = false
  17. p.Material = "Neon"
  18. p.Position = game.Players.LocalPlayer.Character.Torso.Position
  19. table.insert(Parts, p)
  20. end
  21. for i = 1, 100 do
  22. local p = Instance.new("Part", game.Players.LocalPlayer.Character.Torso)
  23. p.Size = Vector3.new(0.2, 0.2, 0.2)
  24. p.Anchored = true
  25. p.CanCollide = false
  26. p.Material = "Neon"
  27. p.Position = game.Players.LocalPlayer.Character.Torso.Position
  28. table.insert(Parts2, p)
  29. end
  30. local sound = Instance.new("Sound", game.Players.LocalPlayer.Character.Torso)
  31. sound.SoundId = "rbxassetid://503327967"
  32. sound.Volume = 1
  33. sound:Play()
  34. spawn(function()
  35. local SelectedPart = 0
  36. while true do
  37. if Direction == 1 then
  38. if SelectedPart < #Parts then
  39. SelectedPart = SelectedPart + Direction
  40. else
  41. Direction = -1
  42. TColor = BrickColor.Random()
  43. end
  44. elseif Direction == -1 then
  45. if SelectedPart > 1 then
  46. SelectedPart = SelectedPart + Direction
  47. else
  48. Direction = 1
  49. TColor = BrickColor.Random()
  50. end
  51. end
  52. local sel = Parts[SelectedPart]
  53. local sel2 = Parts2[SelectedPart]
  54. sel.BrickColor = BrickColor.Random()
  55. sel2.BrickColor = BrickColor.Random()
  56. loudness = sound.PlaybackLoudness / 500
  57. sel.Size = Vector3.new(loudness, loudness, 0.2)
  58. sel2.Size = Vector3.new(loudness, loudness, 0.2)
  59. wait()
  60. sel.BrickColor = TColor
  61. sel2.BrickColor = TColor
  62. end
  63. end)
  64. game:GetService("RunService").RenderStepped:connect(function()
  65. for i = 1, #Parts do
  66. if i == 1 then
  67. Parts[i].CFrame = Parts[i].CFrame:lerp(game.Players.LocalPlayer.Character.Torso.CFrame, 0.9)
  68. else
  69. Parts[i].CFrame = Parts[i].CFrame:lerp(Parts[i - 1].CFrame * CFrame.Angles(-loudness / 20, math.sin(-loudness / 50), 0) * CFrame.new(0, 0, 0.15), 0.8)
  70. end
  71. end
  72. for i = 1, #Parts2 do
  73. if i == 1 then
  74. Parts2[i].CFrame = Parts2[i].CFrame:lerp(game.Players.LocalPlayer.Character.Torso.CFrame, 0.9)
  75. else
  76. Parts2[i].CFrame = Parts2[i].CFrame:lerp(Parts2[i - 1].CFrame * CFrame.Angles(-loudness / 20, math.sin(loudness / 50), 0) * CFrame.new(0, 0, 0.15), 0.8)
  77. end
  78. end
  79. end)
  80.  
  81. -- visualizer gui
  82.  
  83. local visualizergui = Instance.new("ScreenGui")
  84. local Frame = Instance.new("Frame")
  85. local idvalue = Instance.new("TextBox")
  86. local play = Instance.new("TextButton")
  87. local volume = Instance.new("TextBox")
  88. local pitch = Instance.new("TextBox")
  89. local close = Instance.new("TextButton")
  90. local min = Instance.new("TextButton")
  91. local credits = Instance.new("TextLabel")
  92. local open = Instance.new("TextButton")
  93. local set2 = Instance.new("TextButton")
  94. local set1 = Instance.new("TextButton")
  95. local loop = Instance.new("TextButton")
  96.  
  97. --properties xd
  98. visualizergui.Name = "visualizergui"
  99. visualizergui.Parent = game.Players.LocalPlayer.PlayerGui
  100.  
  101. Frame.Parent = visualizergui
  102. Frame.BackgroundColor3 = Color3.new(0.701961, 0.952941, 1)
  103. Frame.BackgroundTransparency = 0.20000000298023
  104. Frame.BorderColor3 = Color3.new(0.211765, 0.329412, 0.415686)
  105. Frame.BorderSizePixel = 8
  106. Frame.Position = UDim2.new(0, 51, 0, 213)
  107. Frame.Size = UDim2.new(0, 418, 0, 213)
  108. Frame.Active = true
  109. Frame.Draggable = true
  110. Frame.Visible = false
  111.  
  112. idvalue.Name = "idvalue"
  113. idvalue.Parent = Frame
  114. idvalue.BackgroundColor3 = Color3.new(0.666667, 1, 1)
  115. idvalue.BackgroundTransparency = 0.5
  116. idvalue.Size = UDim2.new(0, 418, 0, 50)
  117. idvalue.Font = Enum.Font.Fantasy
  118. idvalue.FontSize = Enum.FontSize.Size24
  119. idvalue.Text = "Put ID plz"
  120. idvalue.TextSize = 24
  121.  
  122. play.Name = "play"
  123. play.Parent = Frame
  124. play.BackgroundColor3 = Color3.new(0.666667, 1, 1)
  125. play.BackgroundTransparency = 0.44999998807907
  126. play.BorderColor3 = Color3.new(0.207843, 0.0901961, 0.0705882)
  127. play.BorderSizePixel = 3
  128. play.Position = UDim2.new(0, 9, 0, 82)
  129. play.Size = UDim2.new(0, 117, 0, 50)
  130. play.Font = Enum.Font.SourceSans
  131. play.FontSize = Enum.FontSize.Size28
  132. play.Text = "Play"
  133. play.TextSize = 28
  134.  
  135. volume.Name = "volume"
  136. volume.Parent = Frame
  137. volume.BackgroundColor3 = Color3.new(0.666667, 1, 1)
  138. volume.BackgroundTransparency = 0.44999998807907
  139. volume.BorderColor3 = Color3.new(0.207843, 0.0901961, 0.0705882)
  140. volume.BorderSizePixel = 3
  141. volume.Position = UDim2.new(0, 151, 0, 82)
  142. volume.Size = UDim2.new(0, 117, 0, 50)
  143. volume.Font = Enum.Font.SourceSans
  144. volume.FontSize = Enum.FontSize.Size28
  145. volume.Text = "Volume"
  146. volume.TextSize = 28
  147.  
  148. pitch.Name = "pitch"
  149. pitch.Parent = Frame
  150. pitch.BackgroundColor3 = Color3.new(0.666667, 1, 1)
  151. pitch.BackgroundTransparency = 0.44999998807907
  152. pitch.BorderColor3 = Color3.new(0.207843, 0.0901961, 0.0705882)
  153. pitch.BorderSizePixel = 3
  154. pitch.Position = UDim2.new(0, 291, 0, 82)
  155. pitch.Size = UDim2.new(0, 117, 0, 50)
  156. pitch.Font = Enum.Font.SourceSans
  157. pitch.FontSize = Enum.FontSize.Size28
  158. pitch.Text = "Pitch"
  159. pitch.TextSize = 28
  160.  
  161. close.Name = "close"
  162. close.Parent = Frame
  163. close.BackgroundColor3 = Color3.new(1, 0, 0.0156863)
  164. close.BackgroundTransparency = 0.40000000596046
  165. close.Position = UDim2.new(0, 393, 0, 190)
  166. close.Size = UDim2.new(0, 25, 0, 23)
  167. close.Font = Enum.Font.SourceSans
  168. close.FontSize = Enum.FontSize.Size28
  169. close.Text = "X"
  170. close.TextSize = 28
  171.  
  172. min.Name = "min"
  173. min.Parent = Frame
  174. min.BackgroundColor3 = Color3.new(0.286275, 0.286275, 1)
  175. min.BackgroundTransparency = 0.40000000596046
  176. min.Position = UDim2.new(0, 357, 0, 190)
  177. min.Size = UDim2.new(0, 25, 0, 23)
  178. min.Font = Enum.Font.SourceSans
  179. min.FontSize = Enum.FontSize.Size36
  180. min.Text = "-"
  181. min.TextSize = 36
  182.  
  183. credits.Name = "credits"
  184. credits.Parent = Frame
  185. credits.BackgroundColor3 = Color3.new(1, 1, 1)
  186. credits.BackgroundTransparency = 1
  187. credits.Position = UDim2.new(0, 0, 0, 161)
  188. credits.Size = UDim2.new(0, 200, 0, 52)
  189. credits.Font = Enum.Font.SourceSans
  190. credits.FontSize = Enum.FontSize.Size14
  191. credits.Text = "credits to mr steal yo bork for gui, i didn't make the visualizer credits to whoever leaked it or made it."
  192. credits.TextSize = 14
  193. credits.TextWrapped = true
  194.  
  195. open.Name = "open"
  196. open.Parent = visualizergui
  197. open.BackgroundColor3 = Color3.new(0.666667, 1, 1)
  198. open.BackgroundTransparency = 0.44999998807907
  199. open.BorderColor3 = Color3.new(0.207843, 0.0901961, 0.0705882)
  200. open.BorderSizePixel = 3
  201. open.Position = UDim2.new(0, 0, 0, 400)
  202. open.Size = UDim2.new(0, 59, 0, 50)
  203. open.Font = Enum.Font.SourceSans
  204. open.FontSize = Enum.FontSize.Size28
  205. open.Text = "Open"
  206. open.TextSize = 28
  207. open.Visible = false
  208.  
  209. set2.Name = "set2"
  210. set2.Parent = Frame
  211. set2.BackgroundColor3 = Color3.new(0.666667, 1, 1)
  212. set2.BackgroundTransparency = 0.44999998807907
  213. set2.BorderColor3 = Color3.new(0.207843, 0.0901961, 0.0705882)
  214. set2.BorderSizePixel = 3
  215. set2.Position = UDim2.new(0, 325, 0, 136)
  216. set2.Size = UDim2.new(0, 55, 0, 25)
  217. set2.Font = Enum.Font.SourceSans
  218. set2.FontSize = Enum.FontSize.Size24
  219. set2.Text = "Set"
  220. set2.TextSize = 24
  221. set2.TextWrapped = true
  222.  
  223. set1.Name = "set1"
  224. set1.Parent = Frame
  225. set1.BackgroundColor3 = Color3.new(0.666667, 1, 1)
  226. set1.BackgroundTransparency = 0.44999998807907
  227. set1.BorderColor3 = Color3.new(0.207843, 0.0901961, 0.0705882)
  228. set1.BorderSizePixel = 3
  229. set1.Position = UDim2.new(0, 181, 0, 136)
  230. set1.Size = UDim2.new(0, 55, 0, 25)
  231. set1.Font = Enum.Font.SourceSans
  232. set1.FontSize = Enum.FontSize.Size24
  233. set1.Text = "Set"
  234. set1.TextSize = 24
  235. set1.TextWrapped = true
  236.  
  237. loop.Name = "loop"
  238. loop.Parent = Frame
  239. loop.BackgroundColor3 = Color3.new(0.666667, 1, 1)
  240. loop.BackgroundTransparency = 0.44999998807907
  241. loop.BorderColor3 = Color3.new(0.207843, 0.0901961, 0.0705882)
  242. loop.BorderSizePixel = 3
  243. loop.Position = UDim2.new(0, 241, 0, 188)
  244. loop.Size = UDim2.new(0, 84, 0, 25)
  245. loop.Font = Enum.Font.SourceSans
  246. loop.FontSize = Enum.FontSize.Size18
  247. loop.Text = "Loop : OFF"
  248. loop.TextSize = 18
  249. loop.TextWrapped = true
  250.  
  251. -- functions
  252. function start()
  253. wait(0.5)
  254. Frame.Position = UDim2.new(0, -500, 0, 400)
  255. Frame.Visible = true
  256. Frame:TweenPosition(UDim2.new(0, 0, 0, 400),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,1)
  257. end
  258.  
  259. if game.Players.LocalPlayer.Character then
  260. start()
  261. else
  262. print'character not found plz try again XD'
  263. end
  264.  
  265. function minimize()
  266. Frame:TweenPosition(UDim2.new(0, 0, 0, 400),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,1)
  267. credits.Text = ""
  268. min.Text = ""
  269. close.Text = ""
  270. play.Text = ""
  271. pitch.Text = ""
  272. volume.Text = ""
  273. idvalue.Text = ""
  274. set1.Text = ""
  275. set2.Text = ""
  276. loop.Text = ""
  277. Frame:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  278. credits:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  279. min:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  280. close:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  281. idvalue:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  282. volume:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  283. play:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  284. pitch:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  285. loop:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  286. set1:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  287. set2:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  288. Frame:TweenPosition(UDim2.new(0, 0, 0, 400),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  289. wait(0.5)
  290. Frame.Visible = false
  291. open.Visible = true
  292. end
  293.  
  294. function show()
  295. open.Visible = false
  296. Frame.Position = UDim2.new(0, -500, 0, 400)
  297. Frame.Visible = true
  298. credits.Text = "credits to me for gui, i didn't make the visualizer credits to whoever leaked it or made it."
  299. min.Text = "-"
  300. close.Text = "X"
  301. play.Text = "Play"
  302. pitch.Text = "Pitch"
  303. volume.Text = "Volume"
  304. idvalue.Text = "Put ID plz"
  305. set1.Text = "Set"
  306. set2.Text = "Set"
  307. loop.Text = "Loop : OFF"
  308. Frame:TweenSize(UDim2.new(0, 418, 0, 213),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  309. credits:TweenSize(UDim2.new(0, 200, 0, 52),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  310. min:TweenSize(UDim2.new(0, 25, 0, 23),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  311. close:TweenSize(UDim2.new(0, 25, 0, 23),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  312. idvalue:TweenSize(UDim2.new(0, 418, 0, 50),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  313. volume:TweenSize(UDim2.new(0, 117, 0, 50),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  314. play:TweenSize(UDim2.new(0, 117, 0, 50),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  315. pitch:TweenSize(UDim2.new(0, 117, 0, 50),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  316. set1:TweenSize(UDim2.new(0, 55, 0, 25),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  317. loop:TweenSize(UDim2.new(0, 84, 0, 25),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  318. set2:TweenSize(UDim2.new(0, 55, 0, 25),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  319. Frame:TweenPosition(UDim2.new(0, 0, 0, 400),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint, 0.5)
  320. end
  321.  
  322. function exitdatshit()
  323. Frame:TweenPosition(UDim2.new(0, 0, 0, 400),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,1)
  324. credits.Text = ""
  325. min.Text = ""
  326. close.Text = ""
  327. play.Text = ""
  328. pitch.Text = ""
  329. volume.Text = ""
  330. idvalue.Text = ""
  331. Frame:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  332. credits:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  333. min:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  334. close:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  335. idvalue:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  336. volume:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  337. play:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  338. pitch:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  339. set1:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  340. set2:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  341. loop:TweenSize(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  342. Frame:TweenPosition(UDim2.new(0, 0, 0, 400),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,0.5)
  343. wait(0.5)
  344. visualizergui:Destroy()
  345. end
  346.  
  347. -- events
  348. wait(1)
  349. min.MouseButton1Down:connect(function()
  350. minimize()
  351. end)
  352.  
  353. open.MouseButton1Down:connect(function()
  354. show()
  355. end)
  356.  
  357. close.MouseButton1Down:connect(function()
  358. exitdatshit()
  359. end)
  360.  
  361. set1.MouseButton1Down:connect(function()
  362. sound.Volume = volume.Text
  363. end)
  364.  
  365. set2.MouseButton1Down:connect(function()
  366. sound.Pitch = pitch.Text
  367. end)
  368.  
  369. play.MouseButton1Down:connect(function()
  370. sound.TimePosition = 0
  371. sound.SoundId = "rbxassetid://" .. idvalue.Text
  372. end)
  373.  
  374. loop.MouseButton1Down:connect(function()
  375. if loop.Text == "Loop : OFF" then
  376. sound.Looped = true
  377. loop.Text = "Loop : ON"
  378. else
  379. sound.Looped = false
  380. loop.Text = "Loop : OFF"
  381. end
  382. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement