Advertisement
Aeyao

bars

Jan 10th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. local maxsize = 1.4
  2.  
  3. local divider = 45
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14. local cam = workspace.CurrentCamera
  15.  
  16. local root = CFrame.new(87,10,-100)* CFrame.Angles(0,math.rad(180),0)
  17. wait()
  18.  
  19. local blurting = Instance.new("BlurEffect",game.Lighting)
  20. blurting.Size = 0
  21. local bloomting = Instance.new("BloomEffect",game.Lighting)
  22. bloomting.Intensity = 0
  23. bloomting.Threshold = 0.980
  24.  
  25. local starterGui = game:GetService('StarterGui')
  26. starterGui:SetCore("TopbarEnabled", false)
  27.  
  28. local updown = 0
  29.  
  30. local rs = game:GetService("RunService").RenderStepped
  31.  
  32. delay(0,function()
  33.  
  34. while rs:wait() do
  35. print("ok")
  36. local vol = workspace.Sound.PlaybackLoudness
  37. updown = updown + 1
  38.  
  39. if updown > 1 then
  40. updown = -1
  41. elseif updown >= 2 or updown == 0 then
  42. updown = 1
  43. end
  44.  
  45. local shake = (vol/90)*updown
  46. local rawfshake = (1 - math.max(1,shake))*-1
  47. local finalshake = (1 - math.max(1,shake))*updown
  48. local finalshake2 = math.random(-rawfshake,rawfshake)*1.5
  49. local finalshake3 = math.random(-rawfshake,rawfshake)*1.5
  50.  
  51. blurting.Size = vol/80
  52. bloomting.Intensity = vol/700
  53. end
  54.  
  55. end)
  56. local p = game.Players.LocalPlayer
  57. local c = p.Character
  58.  
  59. local main = Instance.new("Part",c)
  60.  
  61. local sound = Instance.new("Sound")
  62. sound.Parent = workspace
  63. sound.Playing = true
  64. sound.Looped = true
  65. sound.SoundId = "rbxassetid://385832253"
  66.  
  67. local vol = sound.PlaybackLoudness
  68.  
  69. local brix = {}
  70.  
  71. for i = 1,80 do
  72.  
  73. local brik = Instance.new("Part",main)
  74. brik.Anchored = true
  75. brik.Size = Vector3.new(2,2,2)
  76. brik.CFrame = main.CFrame * CFrame.new(i*2.1,0,0)
  77. brik.Material = "Neon"
  78. brik.BrickColor = BrickColor.new("Really black")
  79.  
  80. local sl = Instance.new("SelectionBox")
  81. sl.Parent = brik
  82. sl.Adornee = brik
  83.  
  84. table.insert(brix,brik)
  85.  
  86. end
  87.  
  88. local MPL,PL
  89. MPL = 0
  90. local smallest = nil
  91. smallest = brix[1]
  92.  
  93. function check(num,size,divider)
  94.  
  95. local sizeofbar = brix[num].Size.Y
  96. if size>sizeofbar then
  97. local cf = brix[num].CFrame
  98. local briksize = brix[num].Size
  99. brix[num].Size = brix[num].Size:lerp(briksize+Vector3.new(0,(size)/divider,0),.2)
  100. brix[num].CFrame = cf
  101. end
  102.  
  103. end
  104. p.Chatted:connect(function(m)
  105. if m == ":stop" then
  106. sound:Destroy()
  107. for I,v in pairs(brix) do
  108. v:Destroy()
  109. end
  110. end
  111. end)
  112.  
  113. function makebar(size)
  114.  
  115. PL = sound.PlaybackLoudness
  116.  
  117. MPL = math.max(PL,MPL)
  118. PL = PL/MPL
  119.  
  120. local one = math.floor(PL*(#brix))
  121.  
  122.  
  123. if one > .1 then
  124. local briksize = brix[one].Size
  125. delay(0,function()
  126. for i = 1,3 do
  127. brix[one].Size = brix[one].Size:lerp(briksize + Vector3.new(0,PL*size,0),.2)
  128. end
  129. end)
  130. end
  131.  
  132.  
  133. for i = 1,17 do
  134. if brix[one-i] then
  135. check(one-i,size,i)
  136. end
  137.  
  138. if brix[one+i] then
  139. check(one+i,size,i)
  140. end
  141. end
  142.  
  143. end
  144.  
  145. rs:connect(function()
  146. local vol = sound.PlaybackLoudness
  147. for i = 1,#brix do
  148. brix[i].Size =brix[i].Size:lerp(Vector3.new(2,0,2),.2)
  149. end
  150. --makebar(20)
  151. makebar((vol^maxsize)/divider)
  152. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement