Advertisement
Its_YeBoi

Wave Visualizer

Apr 15th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. function rainb(hue)
  2. local section = hue % 1 * 3
  3. local secondary = 0.5 * math.pi * (section % 1)
  4. if section < 1 then
  5. return Color3.new(1, 1 - math.cos(secondary), 1 - math.sin(secondary))
  6. elseif section < 2 then
  7. return Color3.new(1 - math.sin(secondary), 1, 1 - math.cos(secondary))
  8. else
  9. return Color3.new(1 - math.cos(secondary), 1 - math.sin(secondary), 1)
  10. end
  11. end
  12.  
  13. --// Mostly made by Omega_Phoenix, some parts needed help #Yeet \\--
  14. local player = game.Players.LocalPlayer
  15. local tofollow = player
  16. local char = tofollow.Character
  17. local ispeed = 65
  18. local ispeed2 = 78
  19. local sine = 50
  20. local sine2 = 34
  21. local size = 4
  22. local maxTabs = 10
  23. local ai = 360/maxTabs
  24. hrp=char["HumanoidRootPart"]
  25. rd=math.rad
  26. local fold = Instance.new("Folder")
  27. fold.Name = "Vis"
  28. fold.Parent = char
  29. --------------------------------------
  30. local siner = coroutine.wrap(function()
  31. while true do wait()
  32. sine = sine+1
  33. end
  34. end)
  35. siner()
  36. --------------------------------------
  37. function TweenMe(joint,prop,cfrmz,alp,es,ed)
  38. local ts = game:GetService("TweenService")
  39. local ti = TweenInfo.new(alp,Enum.EasingStyle[es],Enum.EasingDirection[ed],0,false,0)
  40. local pp = {[prop] = cfrmz}
  41. local tween = ts:Create(joint,ti,pp)
  42. tween:Play()
  43. end
  44. function createPart()
  45. local p = Instance.new("Part")
  46. p.Name = "Dead"
  47. p.Anchored = true
  48.  
  49. p.Transparency = 0
  50. p.CanCollide = false
  51. p.TopSurface = "Smooth"
  52. p.BottomSurface = "Smooth"
  53. p.Material = "Neon"
  54. p.Size = Vector3.new(.1,.1,.1)
  55. p.Transparency = 1
  56. p.CFrame = CFrame.new(hrp.CFrame.p)
  57.  
  58. return p
  59.  
  60.  
  61.  
  62. end
  63.  
  64.  
  65. function createPart2()
  66. local p3 = Instance.new("Part")
  67. p3.Name = "Dead2"
  68. p3.Anchored = true
  69.  
  70. p3.Transparency = 0
  71. p3.CanCollide = false
  72. p3.TopSurface = "Smooth"
  73. p3.BottomSurface = "Smooth"
  74. p3.Material = "Neon"
  75. p3.Size = Vector3.new(.2,size,.2)
  76. p3.CFrame = CFrame.new(hrp.CFrame.p)
  77.  
  78. return p3
  79.  
  80.  
  81.  
  82. end
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. local idk = 4
  91. local eh = 360/idk
  92. for i = 1,360/ai do
  93.  
  94. local p = createPart()
  95. p.Parent = fold
  96. p.CFrame = CFrame.new(hrp.CFrame.p)*CFrame.Angles(rd(0),rd(i*ai),rd(0))*CFrame.new(0,1*math.cos(sine/ispeed),10)
  97. end
  98.  
  99. for i = 1,360/ai do
  100.  
  101. local p2 = createPart2()
  102. p2.Parent = fold
  103. p2.Size = Vector3.new(.2,size,.2)
  104. p2.CFrame = CFrame.new(p2.CFrame.p)*CFrame.Angles(rd(0),rd(i*ai),rd(0))*CFrame.new(0,1*math.cos(sine/ispeed2),10)
  105. end
  106.  
  107. local musics = Instance.new("Sound",char.Torso)
  108. musics.Looped = true
  109. musics.Name = "music"
  110.  
  111. musics.Volume = 10
  112. musics.SoundId = "rbxassetid://1521368773"
  113. musics:Play()
  114. local xsize = 1
  115. local zsize = 1
  116. size = 4
  117. game:GetService("RunService").Heartbeat:connect(function()
  118. local Clr = rainb(tick()/3)
  119. local gc = fold:GetChildren()
  120. for i = 2,#gc,1 do
  121. gc[i].Color = gc[i].Color:lerp(Color3.new(Clr.r,Clr.g,Clr.b),.5)
  122. gc[i].Size = gc[i].Size:lerp(Vector3.new(xsize,musics.PlaybackLoudness/100, zsize),0.6)
  123. end
  124. end)
  125. local pbl = 30
  126. -------------------------------------- game:GetService("RunService").RenderStepped:Wait()
  127. local music = coroutine.wrap(function()
  128. while true do wait()
  129. local gc = fold:GetChildren()
  130. for i = 1,#gc do
  131. sine2=sine2+.3
  132. local l = tick()+sine2
  133. local p = gc[i]
  134. local size2 = size*45
  135. TweenMe(p,'CFrame',hrp.CFrame*CFrame.Angles(rd(0),rd(i*ai),rd(0))*CFrame.new(0,size*math.sin(l)*musics.PlaybackLoudness/500,musics.PlaybackLoudness/pbl),0.5,'Sine','Out')
  136. end
  137. end
  138. end)
  139. music()
  140. --------------------------------------
  141. local playing = false
  142. player.Chatted:connect(function(chat)
  143. local msg = chat
  144. if chat:sub(1,3) == "/vis " then
  145.  
  146. elseif chat:sub(1,8):lower():match('/volume ') then
  147. musics.Volume = chat:sub(9)
  148.  
  149. elseif chat:sub(1,8):lower():match('/follow ') then
  150. for i,v in pairs(workspace:children'') do
  151. if v.Name:lower():match(msg:sub(9):lower()) then
  152. hrp = v["Torso"]
  153. end
  154. end
  155. elseif chat:sub(1,7):lower():match('/pause ') then
  156. musics:Pause()
  157. elseif chat:sub(1,6):lower():match('/play ') then
  158. musics:Pause()
  159. musics.SoundId='rbxassetid://'..msg:sub(7)
  160. musics:Play()
  161. elseif chat:sub(1,8):lower():match('/resume ') then
  162. musics:Resume()
  163. elseif chat:sub(1,5):lower():match('/pbl ') then
  164. pbl = msg:sub(6)
  165. elseif chat:sub(1,7):lower():match('/xsize ') then
  166. xsize = msg:sub(8)
  167. elseif chat:sub(1,7):lower():match('/zsize ') then
  168. zsize = msg:sub(8)
  169. end
  170. end)
  171.  
  172.  
  173.  
  174.  
  175. player.Character.Humanoid.MaxHealth = "Inf"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement