Advertisement
Guest User

Untitled

a guest
Mar 15th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. player = game.Players.LocalPlayer
  2. wait()
  3. script.Parent=nil
  4. active = true
  5. Settings = {
  6.     Prefix = "";
  7.     LerpSpeed = .5;
  8.     MusicLerp = .3;
  9.     Distance = .5;
  10.     Range = 15;
  11.     Height = 4;
  12. }
  13.  
  14. function SpawnBars()
  15.     partmiddle = Instance.new("Part")
  16.     partmiddle.Name = "Bars___"..player.Name
  17.     partmiddle.Size = Vector3.new(.2,4,.2)
  18.     partmiddle.Parent = player.Character
  19.     partmiddle.Anchored = true
  20.     partmiddle.Material = "Neon"
  21.     partmiddle.CanCollide = false
  22.     partleft = partmiddle:Clone()
  23.     partright = partmiddle:Clone()
  24.     partleftfar = partmiddle:Clone()
  25.     partrightfar = partmiddle:Clone()
  26.     partleftfarfar = partmiddle:Clone()
  27.     partrightfarfar = partmiddle:Clone()
  28.     partleftfarfarfar = partmiddle:Clone()
  29.     partrightfarfarfar = partmiddle:Clone()
  30.     partleftfarest = partmiddle:Clone()
  31.     partrightfarest = partmiddle:Clone()
  32.     partleftfarestfar = partmiddle:Clone()
  33.     partrightfarestfar = partmiddle:Clone()
  34.     partleft.Parent = partmiddle
  35.     partright.Parent = partmiddle
  36.     partleftfar.Parent = partmiddle
  37.     partrightfar.Parent = partmiddle
  38.     partleftfarfar.Parent = partmiddle
  39.     partrightfarfar.Parent = partmiddle
  40.     partleftfarfarfar.Parent = partmiddle
  41.     partrightfarfarfar.Parent = partmiddle
  42.     partleftfarest.Parent = partmiddle
  43.     partrightfarest.Parent = partmiddle
  44.     partleftfarestfar.Parent = partmiddle
  45.     partrightfarestfar.Parent = partmiddle
  46. end
  47. function SpawnMusic()
  48.     Sound = Instance.new('Sound',partmiddle)
  49.     Sound.EmitterSize = Settings.Range
  50.     Sound.Looped = true
  51.     Sound.Volume = 1
  52.     Sound:Play()
  53. end
  54.  
  55. game:GetService'RunService'.RenderStepped:connect(function()
  56.     if not active then return end
  57.     if not player.Character:FindFirstChild('Bars___'..player.Name) then
  58.         SpawnBars()
  59.         wait()
  60.     end
  61.     if not player.Character:FindFirstChild('Bars___'..player.Name):FindFirstChild('Sound') then
  62.         SpawnMusic()
  63.         wait()
  64.     else
  65.         if Sound.PlaybackLoudness >= 350 then
  66.             partmiddle.BrickColor = BrickColor.Random()
  67.         end
  68.     end
  69.     pcall(function()
  70.         partmiddle.CFrame = partmiddle.CFrame:Lerp(player.Character.HumanoidRootPart.CFrame*CFrame.new(0,Settings.Height,3),Settings.LerpSpeed)
  71.         partleft.CFrame = partleft.CFrame:Lerp(partmiddle.CFrame*CFrame.new(-Settings.Distance,0,0),Settings.LerpSpeed)
  72.         partright.CFrame = partright.CFrame:Lerp(partmiddle.CFrame*CFrame.new(Settings.Distance,0,0),Settings.LerpSpeed)
  73.         partleftfar.CFrame = partleftfar.CFrame:Lerp(partleft.CFrame*CFrame.new(-Settings.Distance,0,0),Settings.LerpSpeed)
  74.         partrightfar.CFrame = partrightfar.CFrame:Lerp(partright.CFrame*CFrame.new(Settings.Distance,0,0),Settings.LerpSpeed)
  75.         partleftfarfar.CFrame = partleftfarfar.CFrame:Lerp(partleftfar.CFrame*CFrame.new(-Settings.Distance,0,0),Settings.LerpSpeed)
  76.         partrightfarfar.CFrame = partrightfarfar.CFrame:Lerp(partrightfar.CFrame*CFrame.new(Settings.Distance,0,0),Settings.LerpSpeed)
  77.         partleftfarfarfar.CFrame = partleftfarfarfar.CFrame:Lerp(partleftfarfar.CFrame*CFrame.new(-Settings.Distance,0,0),Settings.LerpSpeed)
  78.         partrightfarfarfar.CFrame = partrightfarfarfar.CFrame:Lerp(partrightfarfar.CFrame*CFrame.new(Settings.Distance,0,0),Settings.LerpSpeed)
  79.         partleftfarest.CFrame = partleftfarest.CFrame:Lerp(partleftfarfarfar.CFrame*CFrame.new(-Settings.Distance,0,0),Settings.LerpSpeed)
  80.         partrightfarest.CFrame = partrightfarest.CFrame:Lerp(partrightfarfarfar.CFrame*CFrame.new(Settings.Distance,0,0),Settings.LerpSpeed)
  81.         partleftfarestfar.CFrame = partleftfarestfar.CFrame:Lerp(partleftfarest.CFrame*CFrame.new(-Settings.Distance,0,0),Settings.LerpSpeed)
  82.         partrightfarestfar.CFrame = partrightfarestfar.CFrame:Lerp(partrightfarest.CFrame*CFrame.new(Settings.Distance,0,0),Settings.LerpSpeed)
  83.     end)
  84.     local Color =  partmiddle.BrickColor
  85.     local Color_2 = partleft.BrickColor
  86.     local Color_3 = partleftfar.BrickColor
  87.     local Color_4 = partleftfarfar.BrickColor
  88.     local Color_5 = partleftfarfarfar.BrickColor
  89.     local Prev_Size = partmiddle.Size
  90.     local Prev_Size2 = partleft.Size
  91.     local Prev_Size3 = partleftfar.Size
  92.     local Prev_Size4 = partleftfarfar.Size
  93.     local Prev_Size5 = partleftfarfarfar.Size
  94.     partmiddle.Size = partmiddle.Size:Lerp(Vector3.new(.3,Sound.PlaybackLoudness/100,.3),Settings.MusicLerp)
  95.     wait()
  96.     partleft.Size = partleft.Size:Lerp(Prev_Size,Settings.MusicLerp)
  97.     partright.Size = partright.Size:Lerp(Prev_Size,Settings.MusicLerp)
  98.     partleft.BrickColor = Color
  99.     partright.BrickColor = Color
  100.     wait()
  101.     partleftfar.Size = partleftfar.Size:Lerp(Prev_Size2,Settings.MusicLerp)
  102.     partrightfar.Size = partrightfar.Size:Lerp(Prev_Size2,Settings.MusicLerp)
  103.     partleftfar.BrickColor = Color_2
  104.     partrightfar.BrickColor = Color_2
  105.     wait()
  106.     partleftfarfar.Size = partleftfarfar.Size:Lerp(Prev_Size3,Settings.MusicLerp)
  107.     partrightfarfar.Size = partrightfarfar.Size:Lerp(Prev_Size3,Settings.MusicLerp)
  108.     partleftfarfar.BrickColor = Color_3
  109.     partrightfarfar.BrickColor = Color_3
  110.     wait()
  111.     partleftfarfarfar.Size = partleftfarfarfar.Size:Lerp(Prev_Size4,Settings.MusicLerp)
  112.     partrightfarfarfar.Size = partrightfarfarfar.Size:Lerp(Prev_Size4,Settings.MusicLerp)
  113.     partleftfarfarfar.BrickColor = Color_4
  114.     partrightfarfarfar.BrickColor = Color_4
  115.     wait()
  116.     partleftfarest.Size = partleftfarest.Size:Lerp(Prev_Size5,Settings.MusicLerp)
  117.     partrightfarest.Size = partleftfarest.Size:Lerp(Prev_Size5,Settings.MusicLerp)
  118.     partleftfarest.BrickColor = Color_5
  119.     partrightfarest.BrickColor = Color_5
  120. end)
  121.  
  122. Chatted = player.Chatted:connect(function(msg)
  123.     if msg:lower():sub(1,#Settings.Prefix+#'play ')==Settings.Prefix..'play ' then
  124.         if not partmiddle:FindFirstChild('Sound') then SpawnMusic() end
  125.         local Sound = partmiddle:FindFirstChild('Sound')
  126.         Sound:Stop()
  127.         Sound.SoundId = "http://www.roblox.com/asset?id="..tonumber(msg:sub(#Settings.Prefix+#'play '+1))
  128.         Sound:Play()
  129.     end
  130.     if msg:lower():sub(1,#Settings.Prefix+#'stop')==Settings.Prefix..'stop' then
  131.         local Sound = partmiddle:FindFirstChild('Sound')
  132.         if Sound and Sound.Playing then Sound:Stop() end
  133.     end
  134.     if msg:lower():sub(1,#Settings.Prefix+#'vol ')==Settings.Prefix..'vol ' then
  135.         local Sound = partmiddle:FindFirstChild('Sound')
  136.         if Sound then
  137.             Sound.Volume = tonumber(msg:sub(#Settings.Prefix+#'vol '+1))
  138.         end
  139.         print('Volume: '..tonumber(msg:sub(#Settings.Prefix+#'vol '+1)))
  140.     end
  141.     if msg:lower():sub(1,#Settings.Prefix+#'height ')==Settings.Prefix..'height ' then
  142.         Settings.Height = tonumber(msg:sub(#Settings.Prefix+#'height '+1))
  143.         print('Height: '..tonumber(msg:sub(#Settings.Prefix+#'height '+1)))
  144.     end
  145.     if msg:lower():sub(1,#Settings.Prefix+#'space ')==Settings.Prefix..'space ' then
  146.         Settings.Distance = tonumber(msg:sub(#Settings.Prefix+#'space '+1))
  147.         print("Space: "..tonumber(msg:sub(#Settings.Prefix+#'space '+1)))
  148.     end
  149.     if msg:lower():sub(1,#Settings.Prefix+#'range ')==Settings.Prefix..'range ' then
  150.         Settings.Range = tonumber(msg:sub(#Settings.Prefix+#'range '+1))
  151.         local Sound = partmiddle:FindFirstChild('Sound')
  152.         if Sound then
  153.             Sound.EmitterSize = tonumber(msg:sub(#Settings.Prefix+#'range '+1))
  154.         end
  155.         print('Range: '..tonumber(msg:sub(#Settings.Prefix+#'range '+1)))
  156.     end
  157.     if msg:lower():sub(1,#Settings.Prefix+#'smooth ')==Settings.Prefix..'smooth ' then
  158.         Settings.LerpSpeed = tonumber(msg:sub(#Settings.Prefix+#'smooth '+1))
  159.         print('Smooth: '..tonumber(msg:sub(#Settings.Prefix+#'smooth '+1)))
  160.     end
  161.     if msg:lower():sub(1,#Settings.Prefix+#'mbounce ')==Settings.Prefix..'mbounce ' then
  162.         Settings.MusicLerp = tonumber(msg:sub(#Settings.Prefix+#'mbounce '+1))
  163.         print('Music Bounce: '..tonumber(msg:sub(#Settings.Prefix+#'mbounce '+1)))
  164.     end
  165.     if msg:lower():sub(1,#Settings.Prefix+#'rmv')==Settings.Prefix..'rmv' then
  166.         active = false
  167.         partmiddle:Destroy()
  168.         Chatted:disconnect()
  169.         print("Removed MusicBars")
  170.         script:Destroy()
  171.     end
  172. end)
  173. game:GetService("RunService").RenderStepped:connect(function()
  174.     if char:FindFirstChild("Humanoid") == nil then
  175.         local humc = humc:Clone()
  176.         humc.Parent = char
  177.                 hum = humc
  178.         char.Animate:Remove()
  179.         local animc = animc:Clone()
  180.         animc.Parent = char
  181.     elseif char:FindFirstChild("Humanoid").Health <= 0 then
  182.         char.Humanoid:Remove()
  183.         char.Animate:Remove()
  184.         local animc = animc:Clone()
  185.         animc.Parent = char
  186.         end
  187.     if char:FindFirstChild("Left Arm") == nil then
  188.         local humc = larmc:Clone()
  189.         humc.Parent = char
  190.                 larm = humc
  191.                 local humcs = lshc:Clone()
  192.         humcs.Parent = char.Torso
  193.         humcs.Part0 = char.Torso
  194.         humcs.Part1 = humc
  195.                 lsh = humcs
  196.         char.Animate:Remove()
  197.         local animc = animc:Clone()
  198.         animc.Parent = char
  199.         end
  200.     if char:FindFirstChild("Right Arm") == nil then
  201.         local humc = rarmc:Clone()
  202.         humc.Parent = char
  203.                 rarm = humc
  204.                 local humcs = rshc:Clone()
  205.         humcs.Parent = char.Torso
  206.         humcs.Part0 = char.Torso
  207.         humcs.Part1 = humc
  208.                 rsh = humcs
  209.         char.Animate:Remove()
  210.         local animc = animc:Clone()
  211.         animc.Parent = char
  212.         end
  213.     if char:FindFirstChild("Right Leg") == nil then
  214.         local humc = rlegc:Clone()
  215.         humc.Parent = char
  216.                 rleg = humc
  217.         local humcs = rhpc:Clone()
  218.         humcs.Parent = char.Torso
  219.         humcs.Part0 = char.Torso
  220.         humcs.Part1 = humc
  221.                 rhp = humcs
  222.         char.Animate:Remove()
  223.         local animc = animc:Clone()
  224.         animc.Parent = char
  225.         end
  226.     if char:FindFirstChild("Left Leg") == nil then
  227.         local humc = llegc:Clone()
  228.         humc.Parent = char
  229.                 lleg = humc
  230.                 local humcs = lhpc:Clone()
  231.         humcs.Parent = char.Torso
  232.         humcs.Part0 = char.Torso
  233.         humcs.Part1 = humc
  234.                 lhp = humcs
  235.         char.Animate:Remove()
  236.         local animc = animc:Clone()
  237.         animc.Parent = char
  238.         end
  239.     if char:FindFirstChild("Torso") == nil then
  240.         char:FindFirstChild("HumanoidRootPart"):Remove()
  241.         char:FindFirstChild("Head"):Remove()
  242.         local humc = torsc:Clone()
  243.         humc.Parent = char
  244.         tors = humc
  245.         char.Animate:Remove()
  246.         local animc = animc:Clone()
  247.         animc.Parent = char
  248.         end
  249.     if char:FindFirstChild("HumanoidRootPart") == nil then
  250.         local humc = humprtc:Clone()
  251.         humc.Parent = char
  252.         humprt = humc
  253.         humprt.CFrame = pos
  254.         char.HumanoidRootPart.RootJoint:Remove()
  255.         char.Humanoid:Remove()
  256.         local humc = humc:Clone()
  257.         humc = char
  258.         char.Animate:Remove()
  259.         local animc = animc:Clone()
  260.         animc.Parent = char
  261.     end
  262.     if char.HumanoidRootPart:FindFirstChild("RootJoint") == nil then
  263.         local humcs = rjc:Clone()
  264.         humcs.Parent = char.HumanoidRootPart
  265.         humcs.Part0 = char.HumanoidRootPart
  266.         humcs.Part1 = char.Torso
  267.         rj = humcs
  268.     end
  269.     if char:FindFirstChild("Head") == nil then
  270.         local humc = hedc:Clone()
  271.         humc.Parent = char
  272.                 hed = humc
  273.         char.Animate:Remove()
  274.         local animc = animc:Clone()
  275.         animc.Parent = char
  276.     end
  277.     if char.Torso:FindFirstChild("Neck") == nil then
  278.          local humcs = nckc:Clone()
  279.         humcs.Parent = char.Torso
  280.         humcs.Part0 = char.Torso
  281.         humcs.Part1 = humc
  282.         nck = humcs
  283.     end
  284.     if char:FindFirstChild("Body Colors") == nil then
  285.         local humcs = bodycolorc:Clone()
  286.         humcs.Parent = char
  287.     end
  288.  
  289. print("Music Bars Loaded")
  290. print("Created By: WaverlyCole")
  291. print("Edited By: UndeniableInfinity")
  292. print("Though The Infinite Health Respawn Is Broken, At Least, It Still Works!")
  293. print("Say 'play [ID] to play a song.")
  294. print("Say 'stop' to stop a song.")
  295. print("Say 'vol [#]' to change the volume.")
  296. print("Say 'smooth [#0-1]' to change the follow speed.")
  297. print("Say 'mbounce [#0-1] to change the music bounce.'")
  298. print("Say 'range [#]' to change the music range.")
  299. print("Say 'rmv' to remove all functions.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement