Advertisement
NightGamingVN

public script 2 - visualizer gui

Jun 16th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.04 KB | None | 0 0
  1. --[[
  2. GUI visuallizer by pdnghiaqoi [ marseio ]
  3. Go to line 106 for tutorial of custom background.
  4. Run in client-side (localscript)
  5. List of the commands avaliable in this script:
  6. /vol number -- Change the volume of the sound
  7. /pit number -- Change the pitch of the sound
  8. /loop true | flase -- Set the sound to be looped or not.
  9. /cust true | false -- Make the custom background to be shown or not.
  10. /img imageid -- Change the image of the custom background
  11. /id soundid -- Change the SoundId of the sound
  12. /play -- Play the sound.
  13. /stop -- Stop the sound.
  14. ]]
  15. script.Parent = game:GetService("Players").LocalPlayer.PlayerGui
  16. ScreenGui0 = Instance.new("ScreenGui")
  17. Frame1 = Instance.new("Frame")
  18. Frame2 = Instance.new("Frame")
  19. Frame3 = Instance.new("Frame")
  20. Frame69 = Instance.new("Frame")
  21. Frame69.Name = "now"
  22. Frame69.Parent = Frame3
  23. Frame69.Size = UDim2.new(0, 0, 0, 5)
  24. Frame69.BackgroundColor = BrickColor.new("Institutional white")
  25. Frame69.BackgroundColor3 = Color3.new(1, 1, 1)
  26. Frame69.ZIndex = 3
  27. TextLabel4 = Instance.new("TextLabel")
  28. ImageLabel5 = Instance.new("ImageLabel")
  29. TextLabel6 = Instance.new("TextLabel")
  30. Frame7 = Instance.new("Frame")
  31. ScreenGui0.Parent = script
  32. ImageLabel0 = Instance.new("ImageLabel")
  33. ImageLabel0.Name = "cs"
  34. ImageLabel0.Parent = Frame69
  35. ImageLabel0.Position = UDim2.new(1, -5, 0.5, -5)
  36. ImageLabel0.Size = UDim2.new(0, 10, 0, 10)
  37. ImageLabel0.BackgroundColor = BrickColor.new("Institutional white")
  38. ImageLabel0.BackgroundColor3 = Color3.new(1, 1, 1)
  39. ImageLabel0.BackgroundTransparency = 1
  40. ImageLabel0.ZIndex = 4
  41. ImageLabel0.Image = "rbxassetid://232918622"
  42. ImageLabel1 = Instance.new("ImageLabel")
  43. ImageLabel2 = Instance.new("ImageLabel")
  44. ImageLabel1.Name = "hexagon1"
  45. ImageLabel1.Parent = Frame1
  46. ImageLabel1.Position = UDim2.new(0.5, -100, 0.5, -100)
  47. ImageLabel1.Rotation = 150
  48. ImageLabel1.Size = UDim2.new(0, 200, 0, 200)
  49. ImageLabel1.BackgroundColor = BrickColor.new("Institutional white")
  50. ImageLabel1.BackgroundColor3 = Color3.new(1, 1, 1)
  51. ImageLabel1.BackgroundTransparency = 1
  52. ImageLabel1.ZIndex = 3
  53. ImageLabel1.Image = "rbxassetid://3256927769"
  54. ImageLabel2.Name = "hexagon2"
  55. ImageLabel2.Parent = Frame1
  56. ImageLabel2.Position = UDim2.new(0.5, -25, 0.5, -25)
  57. ImageLabel2.Size = UDim2.new(0, 50, 0, 50)
  58. ImageLabel2.BackgroundColor = BrickColor.new("Institutional white")
  59. ImageLabel2.BackgroundColor3 = Color3.new(1, 1, 1)
  60. ImageLabel2.BackgroundTransparency = 1
  61. ImageLabel2.ZIndex = 3
  62. ImageLabel2.Image = "rbxassetid://3256927769"
  63. Frame1.Name = "Background"
  64. Frame1.Parent = ScreenGui0
  65. Frame1.Position = UDim2.new(1, -355, 1, -205)
  66. Frame1.Size = UDim2.new(0, 350, 0, 200)
  67. Frame1.BackgroundColor = BrickColor.new("Really black")
  68. Frame1.BackgroundColor3 = Color3.new(0, 0, 0)
  69. Frame1.BorderColor = BrickColor.new("Institutional white")
  70. Frame1.BorderColor3 = Color3.new(1, 1, 1)
  71. Frame1.BorderSizePixel = 5
  72. Frame2.Name = "BarHolder"
  73. Frame2.Parent = Frame1
  74. Frame2.Position = UDim2.new(0.5, -160, 1, -135)
  75. Frame2.Size = UDim2.new(0, 320, 0, 125)
  76. Frame2.BackgroundColor = BrickColor.new("Institutional white")
  77. Frame2.BackgroundColor3 = Color3.new(1, 1, 1)
  78. Frame2.BackgroundTransparency = 1
  79. Frame2.ZIndex = 3
  80. Frame3.Name = "UnderBar"
  81. Frame3.Parent = Frame1
  82. Frame3.Position = UDim2.new(0.5, -170,1, -135)
  83. Frame3.Size = UDim2.new(0, 340, 0, 5)
  84. Frame3.BackgroundColor = BrickColor.new("Toothpaste")
  85. Frame3.BackgroundColor3 = Color3.new(0, 1, 1)
  86. Frame3.BackgroundTransparency = 0.3
  87. Frame3.BorderSizePixel = 0
  88. Frame3.ZIndex = 4
  89. TextLabel4.Name = "Title"
  90. TextLabel4.Parent = Frame1
  91. TextLabel4.Position = UDim2.new(0, 0, 0, 5)
  92. TextLabel4.Size = UDim2.new(1, 0, 0, 50)
  93. TextLabel4.BackgroundColor = BrickColor.new("Institutional white")
  94. TextLabel4.BackgroundColor3 = Color3.new(1, 1, 1)
  95. TextLabel4.BackgroundTransparency = 1
  96. TextLabel4.ZIndex = 3
  97. TextLabel4.Font = Enum.Font.SourceSansLight
  98. TextLabel4.FontSize = Enum.FontSize.Size24
  99. TextLabel4.Text = "Now playing:"
  100. TextLabel4.TextColor = BrickColor.new("Institutional white")
  101. TextLabel4.TextColor3 = Color3.new(1, 1, 1)
  102. TextLabel4.TextSize = 20
  103. TextLabel4.TextWrap = true
  104. TextLabel4.TextWrapped = true
  105. TextLabel4.TextYAlignment = Enum.TextYAlignment.Top
  106. ImageLabel5.Name = "CustomBG"
  107. ImageLabel5.Parent = Frame1
  108. ImageLabel5.Visible = false
  109. ImageLabel5.Size = UDim2.new(1, 0, 1, 0)
  110. ImageLabel5.BackgroundColor = BrickColor.new("Institutional white")
  111. ImageLabel5.BackgroundColor3 = Color3.new(1, 1, 1)
  112. ImageLabel5.BackgroundTransparency = 1
  113. ImageLabel5.ZIndex = 2
  114. ImageLabel5.Image = "rbxassetid://3176919963"
  115. TextLabel6.Parent = Frame1
  116. TextLabel6.Position = UDim2.new(0, 0, -1, 170)
  117. TextLabel6.Size = UDim2.new(1, 0, 0, 30)
  118. TextLabel6.BackgroundColor = BrickColor.new("Institutional white")
  119. TextLabel6.BackgroundColor3 = Color3.new(1, 1, 1)
  120. TextLabel6.BorderColor = BrickColor.new("Institutional white")
  121. TextLabel6.BorderColor3 = Color3.new(1, 1, 1)
  122. TextLabel6.BorderSizePixel = 5
  123. TextLabel6.ZIndex = 0
  124. TextLabel6.Font = Enum.Font.SourceSansLight
  125. TextLabel6.FontSize = Enum.FontSize.Size28
  126. TextLabel6.Text = "pdn's visuallizer"
  127. TextLabel6.TextColor = BrickColor.new("Really black")
  128. TextLabel6.TextColor3 = Color3.new(0, 0, 0)
  129. TextLabel6.TextSize = 25
  130. TextLabel6.TextWrap = true
  131. TextLabel6.TextWrapped = true
  132. Frame7.Name = "Bar"
  133. Frame7.Parent = Frame1
  134. Frame7.Position = UDim2.new(0, 0, 0, 5)
  135. Frame7.Size = UDim2.new(0, 1, 0, 125)
  136. Frame7.BackgroundColor = BrickColor.new("Institutional white")
  137. Frame7.BackgroundColor3 = Color3.new(1, 1, 1)
  138. Frame7.BackgroundTransparency = 0.5
  139. Frame7.BorderSizePixel = 0
  140. Frame7.ZIndex = 3
  141. TextLabel0 = Instance.new("TextLabel")
  142. TextLabel1 = Instance.new("TextLabel")
  143. TextLabel0.Name = "TL"
  144. TextLabel0.Parent = Frame1
  145. TextLabel0.Position = UDim2.new(1, -45, 0, 5)
  146. TextLabel0.Size = UDim2.new(0, 45, 0, 25)
  147. TextLabel0.BackgroundColor3 = Color3.new(0, 0, 0)
  148. TextLabel0.BackgroundTransparency = 0.5
  149. TextLabel0.ZIndex = 3
  150. TextLabel0.Font = Enum.Font.SourceSansLight
  151. TextLabel0.FontSize = Enum.FontSize.Size24
  152. TextLabel0.Text = "0:00"
  153. TextLabel0.TextColor3 = Color3.new(1, 1, 1)
  154. TextLabel0.TextSize = 20
  155. TextLabel0.BorderSizePixel = 0
  156. TextLabel0.TextWrap = true
  157. TextLabel0.TextWrapped = true
  158. TextLabel0.TextYAlignment = Enum.TextYAlignment.Top
  159. TextLabel1.Name = "TP"
  160. TextLabel1.Parent = Frame1
  161. TextLabel1.Position = UDim2.new(0, 0, 0, 5)
  162. TextLabel1.Size = UDim2.new(0, 45, 0, 25)
  163. TextLabel1.BackgroundColor3 = Color3.new(0, 0, 0)
  164. TextLabel1.BackgroundTransparency = 0.5
  165. TextLabel1.ZIndex = 3
  166. TextLabel1.BorderSizePixel = 0
  167. TextLabel1.Font = Enum.Font.SourceSansLight
  168. TextLabel1.FontSize = Enum.FontSize.Size24
  169. TextLabel1.Text = "0:00"
  170. TextLabel1.TextColor3 = Color3.new(1, 1, 1)
  171. TextLabel1.TextSize = 20
  172. TextLabel1.TextWrap = true
  173. TextLabel1.TextWrapped = true
  174. TextLabel1.TextYAlignment = Enum.TextYAlignment.Top
  175. print("pdn's music 'visuallizer' by pdnghiaqoi [marseio]")
  176. print("say /help for commands")
  177. local max = 125
  178. local maxy = 320
  179. local hex = 200
  180. local h3x = 375
  181. local minus = 1000 / max
  182. local minus1 = 1000 / hex
  183. local minus2 = 1000 / h3x
  184. local background = Frame1
  185. local holder = Frame2
  186. local a = holder:Clone()
  187. local customimage = ImageLabel5
  188. local title = TextLabel4
  189. local udbar = Frame3
  190. local bar = Frame7
  191.  
  192. local pos = TextLabel1
  193. local len = TextLabel0
  194.  
  195. local now = Frame69
  196. local cuscir = ImageLabel0
  197.  
  198. local hex1 = ImageLabel1
  199. local hex2 = ImageLabel2
  200.  
  201. local setting = {
  202. volume = 5;
  203. pitch = 1;
  204. loop = true;
  205. sound = 1321159028;
  206. custom = false; -- Set this to true if you want custom background.
  207. image = 2634887876; -- Change this to some decal id if you want custom background. (if you setted custom to true)
  208. circle = {3256415253,3256415498}; -- Change this to some decal id if you want custom progress bar's icon.
  209. dely = 0.3; -- The time delay if there more than 2 progress bar's logo.
  210. color = BrickColor.new("Institutional white").Color; -- The color for the progress bar.
  211. sizex = 25;
  212. sizey = 20;
  213. updated = false;
  214. target = nil
  215. };
  216.  
  217. local snd = Instance.new("Sound")
  218. snd.Parent = script
  219. snd.Volume = setting.volume
  220. snd.Pitch = setting.pitch
  221. snd.SoundId = "rbxassetid://"..setting.sound
  222. snd.Looped = setting.loop
  223. title.Text = "Now playing: \n"..game:GetService("MarketplaceService"):GetProductInfo(setting.sound).Name
  224. wait()
  225. snd:Play()
  226. function update()
  227. pcall(function()
  228. if setting.updated == false or not setting.target then return end
  229. wait()
  230. if setting.target == "custom" then
  231. if setting.custom == true then
  232. if not setting.image then print("Custom background fail. You didn't put a id!") return end
  233. customimage.Image = "rbxassetid://"..setting.image
  234. customimage.Visible = true
  235. elseif setting.custom == false then
  236. customimage.Visible = false
  237.  
  238. end
  239. elseif setting.target == "volume" then
  240. snd.Volume = setting.volume
  241. elseif setting.target == "pitch" then
  242. snd.Pitch = setting.pitch
  243. elseif setting.target == "sound" then
  244. snd:Stop()
  245. snd.SoundId = "rbxassetid://"..setting.sound
  246. replace()
  247. snd:Play()
  248. title.Text = "Now playing: \n"..game:GetService("MarketplaceService"):GetProductInfo(setting.sound).Name
  249. print("played")
  250. elseif setting.target == "loop" then
  251. snd.Looped = setting.loop
  252. elseif setting.target == "play" then
  253. snd:Play()
  254. elseif setting.target == "stop" then
  255. snd:Stop()
  256. end
  257. print("current settings\ncustom = "..tostring(setting.custom).."\nimage = "..setting.image.."\nvolume = "..setting.volume.."\npitch = "..setting.pitch.."\nloop = "..tostring(setting.loop).."\nsound = "..setting.sound.." | "..game:GetService("MarketplaceService"):GetProductInfo(setting.sound).Name.."\nplaying = "..tostring(snd.Playing))
  258. setting.updated = false
  259. end)
  260. end
  261. function replace()
  262. holder:Remove()
  263. holder = a:Clone()
  264. holder.Parent = background
  265. end
  266. function upd(target)
  267. setting.updated = true
  268. setting.target = target
  269. end
  270. upd("custom")
  271. spawn(function()
  272. while wait() do
  273. update()
  274. end
  275. end)
  276. spawn(function()
  277. while true do
  278. for i = 0, maxy do
  279. if snd and snd.Playing then
  280. local a = bar:Clone()
  281. a.Position = UDim2.new(0, i,0, 5)
  282. a.Size = UDim2.new(0, 1, 0, (snd.PlaybackLoudness / minus))
  283. if 250 > snd.PlaybackLoudness then
  284. a.BackgroundColor3 = BrickColor.new("Institutional white").Color
  285. elseif 750 > snd.PlaybackLoudness then
  286. a.BackgroundColor3 = BrickColor.new("New Yeller").Color
  287. elseif snd.PlaybackLoudness >= 750 then
  288. a.BackgroundColor3 = BrickColor.new("Really red").Color
  289. end
  290. a.Parent = holder
  291. a.Visible = true
  292. end
  293. wait()
  294. end
  295. replace()
  296. end
  297. end)
  298.  
  299. function emptycheck(tabl)
  300. for i, v in pairs(tabl) do
  301. return false
  302. end
  303. return true
  304. end
  305.  
  306. function convert(second)
  307. local s = math.floor(second)
  308. local min = math.floor(s/60)
  309. local sec = math.floor(s-(min*60))
  310. if sec < 10 then sec = "0"..sec end
  311. return (min..":"..sec)
  312. end
  313. spawn(function()
  314. while true do
  315. if snd and snd.Playing == true then
  316. local i = convert(snd.TimePosition)
  317. local s = convert(snd.TimeLength)
  318. pos.Text = tostring(i)
  319. len.Text = tostring(s)
  320. end
  321. wait()
  322.  
  323. end
  324. end)
  325. function perfectsize(size)
  326. local a = -math.floor(size / 2)
  327. return a
  328. end
  329.  
  330. spawn(function()
  331. while true do
  332. if not emptycheck(setting.circle) then
  333. for i,v in pairs(setting.circle) do
  334. if setting.custom == true then
  335. cuscir.Image = "http://www.roblox.com/asset/?id="..v
  336. local a = setting.sizex
  337. local b = setting.sizey
  338. local pa,pb = perfectsize(a), perfectsize(b)
  339. cuscir.Size = UDim2.new(0,a,0,b)
  340. cuscir.Position = UDim2.new(1,pa,0.5,pb)
  341. udbar.BackgroundColor3 = setting.color
  342. wait(setting.dely)
  343. elseif setting.custom == false then
  344. cuscir.Image = "http://www.roblox.com/asset/?id=232918622"
  345. local a = 10
  346. local b = 10
  347. local pa,pb = perfectsize(a), perfectsize(b)
  348. cuscir.Size = UDim2.new(0,a,0,b)
  349. cuscir.Position = UDim2.new(1,pa,0.5,pb)
  350. udbar.BackgroundColor3 = BrickColor.new("Toothpaste").Color
  351. wait(setting.dely)
  352. end
  353. end
  354. end
  355. end
  356. end)
  357. spawn(function()
  358. while wait() do
  359. if snd.Playing == true then
  360. local max = 340
  361. local current = snd.TimePosition / snd.TimeLength * max
  362. now.Size = UDim2.new(0, current, 0, 5)
  363. end
  364. end
  365. end)
  366.  
  367. local del = 0
  368. spawn(function()
  369. while wait() do
  370. del = math.random(2.1,10.9)
  371. end
  372. end)
  373. spawn(function()
  374. while wait() do
  375. local ts = game:GetService('TweenService')
  376. local tween = TweenInfo.new(del,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
  377. local t = ts:Create(hex1, tween, {
  378. Rotation = math.random(-1000,1000)
  379. })
  380. t:Play()
  381. wait(del)
  382. t:Cancel()
  383. end
  384. end)
  385.  
  386. spawn(function()
  387. while wait() do
  388. local ts = game:GetService('TweenService')
  389. local tween = TweenInfo.new(del,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
  390. local t = ts:Create(hex2, tween, {
  391. Rotation = math.random(-1000,1000)
  392. })
  393. t:Play()
  394. wait(del)
  395. t:Cancel()
  396. end
  397. end)
  398.  
  399. spawn(function()
  400. while true do
  401. if snd and snd.Playing then
  402. local size1 = snd.PlaybackLoudness / minus1
  403. local size2 = snd.PlaybackLoudness / minus2
  404. local pf1 = perfectsize(size1)
  405. local pf2 = perfectsize(size2)
  406. hex1.Position = UDim2.new(0.5, pf1,0.5, pf1)
  407. hex1.Size = UDim2.new(0, size1, 0, size1)
  408. hex2.Position = UDim2.new(0.5, pf2,0.5, pf2)
  409. hex2.Size = UDim2.new(0, size2, 0, size2)
  410. end
  411. wait()
  412. end
  413. end)
  414.  
  415. owner.Chatted:Connect(function(msg)
  416. local mes = msg
  417. if string.sub(msg, 1,3) == "/e " then
  418. mes = string.sub(msg,4)
  419. end
  420. if string.sub(mes,1,5) == "/vol " then
  421. if not tonumber(string.sub(mes,6)) then return end
  422. setting.volume = tonumber(string.sub(mes,6))
  423. upd("volume")
  424. elseif string.sub(mes,1,5) == "/pit " then
  425. if not tonumber(string.sub(mes,5)) then return end
  426. setting.pitch = tonumber(string.sub(mes,6))
  427. upd("pitch")
  428. elseif string.sub(mes,1,4) == "/id " then
  429. if not tonumber(string.sub(mes,5)) then return end
  430. setting.sound = tonumber(string.sub(mes,5))
  431. upd("sound")
  432. elseif string.sub(mes,1,5) == "/img " then
  433. if not tonumber(string.sub(mes,5)) then return end
  434. setting.image = tonumber(string.sub(mes,5))
  435. upd("custom")
  436. elseif string.sub(mes,1,6) == "/cust " then
  437. if string.sub(mes,7) == "true" then
  438. setting.custom = true
  439. elseif string.sub(mes,7) == "false" then
  440. setting.custom = false
  441. else return end
  442. upd("custom")
  443. elseif string.sub(mes,1,6) == "/loop " then
  444. if string.sub(mes,7) == "true" then
  445. setting.loop = true
  446. elseif string.sub(mes,7) == "false" then
  447. setting.loop = false
  448. else return end
  449. upd("loop")
  450. elseif string.sub(mes,1,5) == "/play" then
  451. upd("play")
  452. elseif string.sub(mes,1,5) == "/stop" then
  453. upd("stop")
  454. elseif string.sub(mes,1,5) == "/help" then
  455. print("List of the commands of this script\n/vol number -- Change the volume of the sound\n/pit number -- Change the pitch of the sound\n/loop true | flase -- Set the sound to be looped or not.\n/cust true | false -- Make the custom background to be shown or not.\n/img imageid -- Change the image of the custom background\n/id soundid -- Change the SoundId of the sound\n/play -- Play the sound.\n/stop -- Stop the sound.")
  456. end
  457. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement