Advertisement
Guest User

Superior Boombox Visualizer

a guest
Sep 6th, 2019
1,900
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.36 KB | None | 0 0
  1. print("Hello World, much love from HANdsum ♥. Made for ArchUsagi ♥ *whispers* with much love *whispers*")
  2. local Player = owner
  3. local Char = Player.Character
  4. local tweenService = game:GetService("TweenService")
  5. local CanDo = true
  6. local GMaxPL = 700
  7.  
  8. local BoomboxVis = Instance.new("Part",Char)
  9. BoomboxVis.Size = Vector3.new(2, 1.375, 0.75)
  10. BoomboxVis.Name = "BoomboxVis"
  11. BoomboxVis.CanCollide = false
  12. BoomboxVis.Massless = true
  13. local BVMesh = Instance.new("SpecialMesh", BoomboxVis)
  14. BVMesh.MeshId = "http://www.roblox.com/asset/?id=319536754"
  15. BVMesh.TextureId = "http://www.roblox.com/asset/?id=319536704"
  16. local BVWeld = Instance.new("Weld",BoomboxVis)
  17. BVWeld.C0 = CFrame.new(0,0,-1)
  18. BVWeld.Part0 = BoomboxVis
  19. BVWeld.Part1 = Char.Torso
  20. BoomboxVis.Orientation = Vector3.new(BoomboxVis.Orientation.X,BoomboxVis.Orientation.Y+180,BoomboxVis.Orientation.Z-45)
  21. local Sound = Instance.new("Sound",BoomboxVis)
  22. Sound.Volume = 5
  23.  
  24. local LoudnessEvent = Instance.new("RemoteEvent")
  25. LoudnessEvent.Name = "LoudnessEvent"
  26. LoudnessEvent.Parent = NLS([==[
  27. Player = owner
  28. Volume = 5
  29. Pitch = 1
  30. MaxPL = 700
  31.  
  32. Player.Chatted:Connect(function(message)
  33. if message:sub(1, 6):lower() == ">play " then
  34. Song = "rbxassetid://"..message:sub(7)
  35. else if message:sub(1, 5):lower() == ">play" then
  36. Song = "rbxassetid://"..message:sub(6)
  37. else if message:sub(1, 8):lower() == ">volume " then
  38. Volume = message:sub(9)
  39. else if message:sub(1, 7):lower() == ">volume" then
  40. Volume = message:sub(8)
  41. else if message:sub(1, 7):lower() == ">pitch " then
  42. Pitch = message:sub(8)
  43. else if message:sub(1, 6):lower() == ">pitch" then
  44. Pitch = message:sub(7)
  45. else if message:sub(1, 7):lower() == ">maxpl " then
  46. MaxPL = message:sub(8)
  47. else if message:sub(1, 6):lower() == ">maxpl" then
  48. MaxPL = message:sub(7)
  49. end
  50. end
  51. end
  52. end
  53. end
  54. end
  55. end
  56. end
  57. end)
  58.  
  59. local LoudnessEvent = script.LoudnessEvent
  60.  
  61. game:GetService("RunService").RenderStepped:Connect(function()
  62. if owner.Character:FindFirstChild("BoomboxVis") == nil then
  63. script:Destroy()
  64. return
  65. else
  66. local Music = owner.Character.BoomboxVis:FindFirstChild("Sound")
  67. if Music.PlaybackLoudness ~= nil then
  68. LoudnessEvent:FireServer(Music.PlaybackLoudness, Song, Volume, Pitch, MaxPL)
  69. Song = nil
  70. else
  71. return
  72. end
  73. end
  74. end)
  75. ]==],owner.PlayerGui)
  76.  
  77. LoudnessEvent.OnServerEvent:Connect(function(Plr,PL, Song, Volume, Pitch, MaxPL)
  78. Update(PL, Song, Volume, Pitch, MaxPL)
  79. end)
  80.  
  81. function CreatePart()
  82. local Clone = Instance.new("Part",workspace)
  83. Clone.CFrame = BoomboxVis.CFrame
  84. Clone.Size = Vector3.new(2, 1.375, 0.75)
  85. Clone.Name = "BoomboxVis"
  86. Clone.CanCollide = false
  87. local CloneMesh = Instance.new("SpecialMesh", Clone)
  88. CloneMesh.Scale = BVMesh.Scale
  89. CloneMesh.MeshId = "http://www.roblox.com/asset/?id=319536754"
  90. CloneMesh.TextureId = "http://www.roblox.com/asset/?id=319536704"
  91. local CWeld = Instance.new("Weld",Clone)
  92. CWeld.Part0 = Clone
  93. CWeld.Part1 = BoomboxVis
  94. --local BodyAngularVelocity = Instance.new("BodyAngularVelocity",Clone)
  95. --BodyAngularVelocity.AngularVelocity = Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))
  96.  
  97. local goal = {Transparency = 1}
  98. local Tween = tweenService:Create(Clone,TweenInfo.new (0.5),goal)
  99. Tween:Play()
  100. local goal2 = {Scale = Vector3.new(CloneMesh.Scale.X+3,CloneMesh.Scale.Y+3,CloneMesh.Scale.Z+3)}
  101. local Tween2 = tweenService:Create(CloneMesh,TweenInfo.new (0.6),goal2)
  102. Tween2:Play()
  103. wait(1)
  104. CanDo = true
  105. wait(0.5)
  106. Clone:Destroy()
  107. end
  108.  
  109. function Update(PL, Song, Volume, Pitch, MaxPL)
  110. if BoomboxVis:FindFirstChild("Sound") == nil then
  111. Sound = Instance.new("Sound",BoomboxVis)
  112. Sound.Volume = 5
  113. end
  114.  
  115. if Song ~= nil then
  116. Sound.SoundId = Song
  117. Sound.Volume = 5
  118. Sound:Play()
  119. end
  120.  
  121. if MaxPL ~= GMaxPL then
  122. GMaxPL = MaxPL
  123. end
  124.  
  125. if Pitch ~= Sound.PlaybackSpeed then
  126. Sound.PlaybackSpeed = Pitch
  127. end
  128.  
  129. if Volume ~= Sound.Volume then
  130. Sound.Volume = Volume
  131. end
  132.  
  133. if PL >= tonumber(GMaxPL) and CanDo == true then
  134. CanDo = false
  135. CreatePart()
  136. end
  137. local goal = {Scale = Vector3.new(PL/800+1,PL/800+1,PL/800+1)}
  138. local Tween = tweenService:Create(BVMesh,TweenInfo.new (0.2),goal)
  139. Tween:Play()
  140. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement