View difference between Paste ID: tcUKg0J9 and J5YwZnrj
SHOW: | | - or go back to the newest paste.
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;
9+
	Distance = 1;
10
	Range = 15;
11-
	Height = 4;
11+
	Height = 5;
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
ply = game.Players.LocalPlayer
174
char = ply.Character
175
game:GetService("RunService").RenderStepped:connect(function()
176
    if char:FindFirstChild("Humanoid") == nil then
177
        local humc = humc:Clone()
178
        humc.Parent = char
179
                hum = humc
180
        char.Animate:Remove()
181
        local animc = animc:Clone()
182
        animc.Parent = char
183
    elseif char:FindFirstChild("Humanoid").Health <= 0 then
184
        char.Humanoid:Remove()
185
        char.Animate:Remove()
186
        local animc = animc:Clone()
187
        animc.Parent = char
188
        end
189
    if char:FindFirstChild("Left Arm") == nil then
190
        local humc = larmc:Clone()
191
        humc.Parent = char
192
                larm = humc
193
                local humcs = lshc:Clone()
194
        humcs.Parent = char.Torso
195
        humcs.Part0 = char.Torso
196
        humcs.Part1 = humc
197
                lsh = humcs
198
        char.Animate:Remove()
199
        local animc = animc:Clone()
200
        animc.Parent = char
201
        end
202
    if char:FindFirstChild("Right Arm") == nil then
203
        local humc = rarmc:Clone()
204
        humc.Parent = char
205
                rarm = humc
206
                local humcs = rshc:Clone()
207
        humcs.Parent = char.Torso
208
        humcs.Part0 = char.Torso
209
        humcs.Part1 = humc
210
                rsh = humcs
211
        char.Animate:Remove()
212
        local animc = animc:Clone()
213
        animc.Parent = char
214
        end
215
    if char:FindFirstChild("Right Leg") == nil then
216
        local humc = rlegc:Clone()
217
        humc.Parent = char
218
                rleg = humc
219
        local humcs = rhpc:Clone()
220
        humcs.Parent = char.Torso
221
        humcs.Part0 = char.Torso
222
        humcs.Part1 = humc
223
                rhp = humcs
224
        char.Animate:Remove()
225
        local animc = animc:Clone()
226
        animc.Parent = char
227
        end
228
    if char:FindFirstChild("Left Leg") == nil then
229
        local humc = llegc:Clone()
230
        humc.Parent = char
231
                lleg = humc
232
                local humcs = lhpc:Clone()
233
        humcs.Parent = char.Torso
234
        humcs.Part0 = char.Torso
235
        humcs.Part1 = humc
236
                lhp = humcs
237
        char.Animate:Remove()
238
        local animc = animc:Clone()
239
        animc.Parent = char
240
        end
241
    if char:FindFirstChild("Torso") == nil then
242
        char:FindFirstChild("HumanoidRootPart"):Remove()
243
        char:FindFirstChild("Head"):Remove()
244
        local humc = torsc:Clone()
245
        humc.Parent = char
246
        tors = humc
247
        char.Animate:Remove()
248
        local animc = animc:Clone()
249
        animc.Parent = char
250
        end
251
    if char:FindFirstChild("HumanoidRootPart") == nil then
252
        local humc = humprtc:Clone()
253
        humc.Parent = char
254
        humprt = humc
255
        humprt.CFrame = pos
256
        char.HumanoidRootPart.RootJoint:Remove()
257
        char.Humanoid:Remove()
258
        local humc = humc:Clone()
259
        humc = char
260
        char.Animate:Remove()
261
        local animc = animc:Clone()
262
        animc.Parent = char
263
    end
264
    if char.HumanoidRootPart:FindFirstChild("RootJoint") == nil then
265
        local humcs = rjc:Clone()
266
        humcs.Parent = char.HumanoidRootPart
267
        humcs.Part0 = char.HumanoidRootPart
268
        humcs.Part1 = char.Torso
269
        rj = humcs
270
    end
271
    if char:FindFirstChild("Head") == nil then
272
        local humc = hedc:Clone()
273
        humc.Parent = char
274
                hed = humc
275
        char.Animate:Remove()
276
        local animc = animc:Clone()
277
        animc.Parent = char
278
    end
279
    if char.Torso:FindFirstChild("Neck") == nil then
280
         local humcs = nckc:Clone()
281
        humcs.Parent = char.Torso
282
        humcs.Part0 = char.Torso
283
        humcs.Part1 = humc
284
        nck = humcs
285
    end
286
    if char:FindFirstChild("Body Colors") == nil then
287
        local humcs = bodycolorc:Clone()
288
        humcs.Parent = char
289
    end
290
end)
291
292
print("Music Bars Loaded")
293
print("Created By: WaverlyCole")
294
print("Edited By: UndeniableInfinity")
295
print("Though The Infinite Health Respawn Is Broken, At Least, It Still Works!")
296
print("Say 'play [ID] to play a song.")
297
print("Say 'stop' to stop a song.")
298
print("Say 'vol [#]' to change the volume.")
299
print("Say 'smooth [#0-1]' to change the follow speed.")
300
print("Say 'mbounce [#0-1] to change the music bounce.'")
301
print("Say 'range [#]' to change the music range.")
302
print("Say 'rmv' to remove all functions.")