View difference between Paste ID: 8wWNuiHC and W4ZrWBpZ
SHOW: | | - or go back to the newest paste.
1-
--[Dubstep Gun]--
1+
-- This script has been converted to FE by iPxter
2
3
4
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
5
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
6
do
7
	print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
8
	script.Parent = Player.Character
9
10
	--RemoteEvent for communicating
11
	local Event = Instance.new("RemoteEvent")
12
	Event.Name = "UserInput_Event"
13
14-
plr = game:service'Players'.LocalPlayer
14+
	--Fake event to make stuff like Mouse.KeyDown work
15
	local function fakeEvent()
16-
mouse = plr:GetMouse()
16+
		local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
17
		t.connect = t.Connect
18
		return t
19
	end
20
21
	--Creating fake input objects with fake variables
22
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
23
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
24
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
25
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
26
	end}
27
	--Merged 2 functions into one by checking amount of arguments
28
	CAS.UnbindAction = CAS.BindAction
29
30
	--This function will trigger the events that have been :Connect()'ed
31
	local function te(self,ev,...)
32
		local t = m[ev]
33
		if t and t._fakeEvent and t.Function then
34
			t.Function(...)
35
		end
36
	end
37
	m.TrigEvent = te
38
	UIS.TrigEvent = te
39
40
	Event.OnServerEvent:Connect(function(plr,io)
41
	    if plr~=Player then return end
42
		if io.isMouse then
43
			m.Target = io.Target
44
			m.Hit = io.Hit
45
		else
46
			local b = io.UserInputState == Enum.UserInputState.Begin
47
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
48
				return m:TrigEvent(b and "Button1Down" or "Button1Up")
49
			end
50
			for _,t in pairs(CAS.Actions) do
51
				for _,k in pairs(t.Keys) do
52
					if k==io.KeyCode then
53
						t.Function(t.Name,io.UserInputState,io)
54
					end
55
				end
56
			end
57
			m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
58
			UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
59
	    end
60
	end)
61
	Event.Parent = NLS([==[
62
	local Player = game:GetService("Players").LocalPlayer
63
	local Event = script:WaitForChild("UserInput_Event")
64
65
	local UIS = game:GetService("UserInputService")
66
	local input = function(io,a)
67
		if a then return end
68
		--Since InputObject is a client-side instance, we create and pass table instead
69
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
70
	end
71
	UIS.InputBegan:Connect(input)
72
	UIS.InputEnded:Connect(input)
73
74
	local Mouse = Player:GetMouse()
75
	local h,t
76
	--Give the server mouse data 30 times every second, but only if the values changed
77
	--If player is not moving their mouse, client won't fire events
78
	while wait(1/30) do
79
		if h~=Mouse.Hit or t~=Mouse.Target then
80
			h,t=Mouse.Hit,Mouse.Target
81
			Event:FireServer({isMouse=true,Target=t,Hit=h})
82
		end
83
	end]==],Player.Character)
84
	Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
85
end
86
87
--[Popstar Dubstep Gun]--
88
--[Recolored by kaemi]--
89
--[For SB]--
90
print("DUBSTEP TIME!")
91
function clerp(c1,c2,al)
92
    local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
93
    local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
94
    for i,v in pairs(com1) do 
95
        com1[i] = v+(com2[i]-v)*al
96
    end
97
    return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
98
end
99
100
plr = owner
101
char = plr.Character
102
humanoid = char:findFirstChild("Humanoid")
103
torso = char:findFirstChild("Torso")
104
head = char.Head
105
ra = char:findFirstChild("Right Arm")
106
la = char:findFirstChild("Left Arm")
107
rl = char:findFirstChild("Right Leg")
108
ll = char:findFirstChild("Left Leg")
109
rs = torso:findFirstChild("Right Shoulder")
110
ls = torso:findFirstChild("Left Shoulder")
111
rh = torso:findFirstChild("Right Hip")
112
lh = torso:findFirstChild("Left Hip")
113
neck = torso:findFirstChild("Neck")
114
rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
115
anim = char:findFirstChild("Animate")
116
do --Removing ROBLOX's new Looped bug >_>
117
            local function rec(x)
118
                for i,v in pairs(x:children()) do
119
                    if v:IsA'Animation' then
120
                        v.AnimationId = 'rbxassetid://28159255'
121
                    end
122
                    rec(v)
123
                end
124
            end
125
            rec(anim) --the Animate script
126
        end
127
128
        humanoid.Jump = true
129
130
        wait(.4)
131
132
133
        if anim then
134
        anim:Destroy()
135
        end
136
rootpart = char:findFirstChild("HumanoidRootPart")
137
camera = workspace.CurrentCamera
138
modelforparts = char:findFirstChild("ModelForParts") or Instance.new("Model", char)
139
modelforparts.Name = "ModelForParts"
140
141
function trailconnect(obj, wat)
142
local trail = {}
143
for i = 1, 4 do 
144
local p = Instance.new("Part") 
145
p.BrickColor = obj.BrickColor
146
p.formFactor = "Custom" 
147
p.Size = Vector3.new(1,1,1)
148
p.Locked = true 
149
p.Anchored = true 
150
p.CanCollide = false 
151
local mesh = Instance.new("CylinderMesh", p) 
152
mesh.Name = "Mesh" 
153
table.insert(trail,{p,0}) 
154
end
155
local lastpos = obj.Position 
156
local updatethis = 0 
157
local dontdothis = false
158
game:service'RunService'.Stepped:connect(function()
159
    if wat == true then if dontdothis then return end
160
        for i,v in pairs(trail) do
161
        game:service'Debris':AddItem(obj, 0)
162
        table.remove(v, i)
163
        end
164
        dontdothis = true
165
        return 
166
    end
167
updatethis = ((updatethis) % 4) + 1
168
local dstnc = (obj.Position - lastpos).magnitude 
169
trail[updatethis][1].Mesh.Scale = Vector3.new(.2,dstnc,.2)
170
trail[updatethis][1].Parent = obj.Parent
171
trail[updatethis][1].CFrame = CFrame.new((obj.Position + lastpos)/2,obj.Position) * CFrame.Angles(math.pi/2, 0, 0)
172
trail[updatethis][2] = 0 
173
for i,v in pairs(trail) do 
174
v[2] = v[2] + .15
175
v[1].Transparency = v[2] 
176
end 
177
lastpos = obj.Position
178
end)
179
end 
180
181
do --rayCast
182
    function rayCast(startpos, Speed, Gravity, Dmg, color)
183
        local ran,err = ypcall(function()
184
    local rayPart         = Instance.new("Part")
185
    rayPart.Name          = "RayPart"
186
    rayPart.BrickColor    = BrickColor.new(color)
187
    rayPart.Anchored      = true
188
    rayPart.CanCollide    = false
189
    rayPart.Locked        = true
190
    rayPart.FormFactor    = "Custom"
191-
                    v:findFirstChild("Humanoid").Parent:Destroy()
191+
192
    rayPart.BottomSurface = Enum.SurfaceType.Smooth
193
    rayPart.Size          = Vector3.new(.2, 50, .2)
194
    rayPart:breakJoints()
195
    Instance.new("CylinderMesh", rayPart)
196
    local fire = Instance.new("Fire", rayPart)
197
    fire.Color = rayPart.BrickColor.Color
198
    fire.SecondaryColor = rayPart.BrickColor.Color
199
    fire.Heat = 0
200
    fire.Size = 10
201
    local pl = Instance.new("PointLight", rayPart)
202
    pl.Color = Color3.new(rayPart.BrickColor.r/1.5, rayPart.BrickColor.g/1.5, rayPart.BrickColor.b/1.5)
203
    pl.Range = 18
204
205
    local hitobj = false
206
    local bulletposition = startpos.Position
207
    rayPart.CFrame = startpos.CFrame
208
    trailconnect(rayPart, hitobj)
209
210
   local bulletvelocity = (Vector3.new(math.random(-2,2), math.random(-2,2), math.random(-2,2)))+( mouse.Hit.p - bulletposition).unit*Speed
211
    local bulletlastposition = bulletposition
212
    
213
    coroutine.resume(coroutine.create(function()
214
        while true do
215
216
            local dt = wait()
217
            bulletlastposition = bulletposition
218
            bulletvelocity = bulletvelocity + (Vector3.new(0, -3.81*Gravity, 0)*dt)
219
            bulletposition = bulletposition + (bulletvelocity*dt)
220
            local ray = Ray.new(bulletlastposition,  (bulletposition - bulletlastposition))
221
            local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, {char, modelforparts} )
222
                
223
    if (torso.Position - rayPart.Position).magnitude > 840 then
224
        rayPart:Destroy()
225
        hitobj = true
226
     break
227
    end
228
229
    
230
            if hit then
231
                hitobj = true
232
                    local damage = math.random(Dmg, Dmg+100)
233
                if hit.Parent:findFirstChild("Humanoid") ~= nil then
234
                    hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
235
                elseif hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") then
236
                    hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage
237
                end
238
                local boom = Instance.new("Part", modelforparts)
239-
plrgui = game:service'Players'.LocalPlayer:findFirstChild("PlayerGui")
239+
240
                boom.Anchored = true
241
                boom.FormFactor = "Custom"
242
                boom.Size = Vector3.new(1,1,1)
243
                boom.CanCollide = false
244
                boom.Transparency = 0.25
245
                boom.CFrame = CFrame.new(hitposition.x, hitposition.y, hitposition.z)
246
                boom.TopSurface = 0
247
                boom.BottomSurface = 0
248
                local sphere = Instance.new("SpecialMesh", boom)
249
                sphere.MeshType = "Sphere"
250-
    image.Image = "rbxassetid://189054856"
250+
251
                pl.Color = Color3.new(boom.BrickColor.r/1.5, boom.BrickColor.g/1.5, boom.BrickColor.b/1.5)
252
                pl.Range = 20
253
                for ye = 0, 8 do
254
                    local lite = Instance.new("Part", boom)
255
                    lite.FormFactor = "Custom"
256
                    lite.Size = Vector3.new(.2, 1.5, .2)
257
                    lite.BrickColor = boom.BrickColor
258
                    lite.CanCollide = false
259
                    lite.TopSurface = 0
260
                    lite.Anchored = false
261
                    lite.BottomSurface = 0
262
                    lite.Position = boom.Position + Vector3.new(math.random(-10, 10), math.random(6,15), math.random(-10, 10))
263
                end
264
                    
265
                for i = 0, 20, 2.5 do
266
                    sphere.Scale = sphere.Scale + Vector3.new(i,i,i)
267
                    boom.Transparency = boom.Transparency + i/60
268
                    pl.Range = pl.Range + i/15
269
                 wait()
270
                end
271
                boom:Destroy()
272
            for i,v in pairs(workspace:children()) do
273
                if v:IsA("Model") and v:findFirstChild("Humanoid") then
274
                    if v:findFirstChild("Head") and v:findFirstChild("Torso") then
275
                    if (v:findFirstChild("Torso").Position - boom.Position).magnitude < 16 and v.Name ~= char.Name then
276-
sound.SoundId = "rbxassetid://260366243"
276+
                    v:findFirstChild("Humanoid"):TakeDamage(math.random(Dmg+2,Dmg+6))
277
                    end
278
                    end
279
                end
280
                if v and v:IsA("Part") and v.Name ~= "Base" then
281
                    if (v.Position - boom.Position).magnitude < 16 then
282
                    v:BreakJoints()
283
                    v.TopSurface = 0
284
                    v.BottomSurface = 0
285
                    v.LeftSurface = 0
286
                    v.RightSurface = 0
287
                    v.FrontSurface = 0
288
                    v.BackSurface = 0
289
                    v.Anchored = false
290
                    end
291
                end
292
        end
293
            pcall(function()
294
                bulletposition = hitposition
295
                rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
296
                rayPart:Destroy()
297
            end)
298
                break
299
            end
300
            rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
301
            rayPart.Parent = modelforparts
302
        end
303
    end))
304
 for i = 70, 65, -1.5 do
305
    firing = true
306
    camera.FieldOfView = i
307
    wait()
308
end
309
for i = 65, 70, 2.5 do
310
    firing = false
311
    camera.FieldOfView = i
312
    wait()
313
end
314
end)
315
if err then
316
    print(err)
317
    end
318
end
319
end
320
321
322
charge = 500
323
324
plrgui = owner:findFirstChild("PlayerGui")
325
326
local statusgui = Instance.new("ScreenGui", plrgui)
327
local mainframe = Instance.new("Frame", statusgui)
328
    mainframe.Size = UDim2.new(0, 200, 0, 200)
329
    mainframe.Position = UDim2.new(.75, 0, .75, 0)
330
    mainframe.Style = 3
331
    local image = Instance.new("ImageLabel", mainframe)
332
    image.Size = UDim2.new(1, 0, .47, 0)
333
    image.Position = UDim2.new(0, 0, .235, 0)
334
    image.BackgroundTransparency = 1
335
    image.Image = "rbxassetid://189054889"
336
    local chargetext = Instance.new("TextLabel", mainframe)
337
    chargetext.FontSize = "Size18"
338
    chargetext.Size = UDim2.new(1, 0, .95, 0)
339
    chargetext.TextYAlignment = "Bottom"
340
    chargetext.BackgroundTransparency = 1
341
    chargetext.TextColor3 = Color3.new(1,1,1)
342
    game:service'RunService'.Stepped:connect(function()
343
        chargetext.Text = math.floor(charge).."%"
344
    end)
345
    
346
    
347
348
local rm = Instance.new("Weld", torso)
349
rm.C0 = CFrame.new(1.5, 0.5, 0)
350
rm.C1 = CFrame.new(0, 0.5, 0)
351
rm.Part0 = torso
352
rm.Part1 = ra
353
local lm = Instance.new("Weld", torso)
354
lm.C0 = CFrame.new(-1.5, 0.5, 0)
355
lm.C1 = CFrame.new(0, 0.5, 0)
356
lm.Part0 = torso
357
lm.Part1 = la
358
359
sound = Instance.new("Sound", head)
360-
        main.BrickColor = BrickColor.new("Lily white")
360+
361
sound.SoundId = "rbxassetid://131305943"
362
sound.Looped = true
363
364
365
dancemode = true
366
debounceofsprint = false
367
368
--create func
369
function part(parent, size, color, formfactor, collide, transparency)
370
    if transparency == nil then transparency=0 end
371-
        speaker.BrickColor = BrickColor.new("Lily white")
371+
372
        if formfactor == nil then formfactor="Custom" end
373
        local p = Instance.new("Part", parent)
374
        p.FormFactor = formfactor
375
        p.CanCollide = collide
376
        p.Size = size
377
        p.Locked = true
378
        p.Transparency = transparency
379
        p.Position = torso.Position + Vector3.new(0, 1, 0)
380
        p.BrickColor = color
381
        p.FrontSurface = "SmoothNoOutlines" 
382-
        speaker2.BrickColor = BrickColor.new("Lily white")
382+
383
        p.LeftSurface = "SmoothNoOutlines" 
384
        p.BottomSurface = "SmoothNoOutlines" 
385
        p.TopSurface = "SmoothNoOutlines"  
386
        p.RightSurface = "SmoothNoOutlines"
387
        return p
388
end
389
function wedge(parent, size, color, formfactor, collide, transparency)
390
        if transparency==nil then transparency=0 end
391
    if collide==nil then collide=false end
392
        if formfactor==nil then formfactor="Custom" end
393
        local p = Instance.new("WedgePart", parent)
394
        p.FormFactor = formfactor
395
        p.CanCollide = collide
396
        p.Size = size
397
        p.Locked = true
398
        p.Position = torso.Position
399
        p.BrickColor = color
400
        p.FrontSurface = "SmoothNoOutlines" 
401
        p.BackSurface = "SmoothNoOutlines"         
402
        p.LeftSurface = "SmoothNoOutlines" 
403
        p.BottomSurface = "SmoothNoOutlines" 
404-
        main3.BrickColor = BrickColor.new("Lily white")
404+
405
        p.RightSurface = "SmoothNoOutlines"
406
        return p
407
end 
408
function weld(part0, part1, c0, parent, c1)
409
    if parent == nil then parent=char end
410
    if c1 == nil then c1=CFrame.new() end
411
412
        local wel = Instance.new("Weld", parent)
413
        wel.Part0 = part0
414
        wel.Part1 = part1
415
        wel.C0 = c0
416-
        main4.BrickColor = BrickColor.new("Lily white")
416+
417
        return wel
418
end
419
function specialmesh(parent, meshType, scale, meshId)
420
    if meshId==nil then meshId="" end
421
        local mesh = Instance.new("SpecialMesh", parent)
422
        mesh.Scale = scale
423
        mesh.MeshType = meshType
424
        mesh.MeshId = meshId
425
        return mesh
426
end
427-
        speaker3.BrickColor = BrickColor.new("Lily white")
427+
428
--function part(parent, size, color, formfactor, collide, transparency)
429
--function weld(part0, part1, c0, parent, c1)
430
431
----------------------------------------------------------------------------------------------------------
432
function animatehuman(animationid, object)
433
            local animation = object:findFirstChild("Humanoid"):LoadAnimation(animationid)
434
            animation:Play()
435
end
436
local danceAnim = Instance.new("Animation", char)
437
danceAnim.AnimationId = "http://www.roblox.com/asset/?id=130018893"
438-
        speaker4.BrickColor = BrickColor.new("Lily white")
438+
439
----------------------------------------------------------------------------------------------------------
440
local main = Instance.new("Part", char)
441
        main.FormFactor = "Custom"
442
        main.CanCollide = false
443
        main.Size = Vector3.new(.75, 1, 1.2)
444
        main.Locked = true
445
        main.BrickColor = BrickColor.new("Hot pink")
446
        main.TopSurface = 0
447
        main.BottomSurface = 0
448
        main.Position = torso.Position
449-
        speaker5.BrickColor = BrickColor.new("Lily white")
449+
450
local weld1 = weld(main, ra, CFrame.new(), char, CFrame.new(0, -.8, -.6))
451
    local speaker = Instance.new("Part", char)
452
        speaker.FormFactor = "Custom"
453
        speaker.CanCollide = false
454
        speaker.Size = Vector3.new(1.5, .25, 1.4)
455
        speaker.Locked = true
456
        speaker.BrickColor = BrickColor.new("Hot pink")
457
        speaker.TopSurface = 0
458
        speaker.BottomSurface = 0
459
        speaker.Position = torso.Position
460-
        speaker6.BrickColor = BrickColor.new("Lily white")
460+
461
local weld2 = weld(speaker, main, CFrame.new(), char, CFrame.new(-.25, -1.7, .6))
462
        local speaker2 = Instance.new("Part", char)
463
        speaker2.FormFactor = "Custom"
464
        speaker2.CanCollide = false
465
        speaker2.Size = Vector3.new(1, .25, 2)
466
        speaker2.Locked = true
467
        speaker2.BrickColor = BrickColor.new("Hot pink")
468
        speaker2.TopSurface = 0
469
        speaker2.BottomSurface = 0
470
        speaker2.Position = torso.Position
471
        speaker2:BreakJoints()
472
local weld3 = weld(speaker2, main, CFrame.new(), char, CFrame.new(0, -1.7, -.2))
473
        local main2 = Instance.new("Part", char)
474
        main2.FormFactor = "Custom"
475
        main2.CanCollide = false
476
        main2.Size = Vector3.new(.751, 1, .6)
477
        main2.Locked = true
478
        main2.BrickColor = BrickColor.new("Lily white")
479
        main2.TopSurface = 0
480
        main2.BottomSurface = 0
481
        main2.Position = torso.Position
482
        main2:BreakJoints()
483
local weld4 = weld(main2, ra, CFrame.new(), char, CFrame.new(0, 0, -.9))
484
    local main3 = Instance.new("Part", char)
485
        main3.FormFactor = "Custom"
486
        main3.CanCollide = false
487
        main3.Size = Vector3.new(.751, 1.45, 1)
488
        main3.Locked = true
489
        main3.BrickColor = BrickColor.new("Hot pink")
490
        main3.TopSurface = 0
491
        main3.BottomSurface = 0
492
        main3.Position = torso.Position
493
        main3:BreakJoints()
494
local weld5 = weld(main3, ra, CFrame.new(), char, CFrame.new(0, -1.6, -.9))
495
    local main4 = Instance.new("Part", char)
496
        main4.FormFactor = "Custom"
497
        main4.CanCollide = false
498
        main4.Size = Vector3.new(1, .76, 1)
499
        Instance.new("CylinderMesh", main4)
500
        main4.Locked = true
501
        main4.BrickColor = BrickColor.new("Hot pink")
502
        main4.TopSurface = 0
503
        main4.BottomSurface = 0
504
        main4.Position = torso.Position
505
        main4:BreakJoints()
506
local weld6 = weld(main4, main, CFrame.new(), char, CFrame.new(0, -.15, -.5)*CFrame.Angles(math.pi/2, 0, math.pi/2))
507
    local speaker3 = Instance.new("Part", char)
508
        speaker3.FormFactor = "Custom"
509
        speaker3.CanCollide = false
510
        speaker3.Size = Vector3.new(1.5, .5, 1.4)
511
        speaker3.Locked = true
512
        speaker3.BrickColor = BrickColor.new("Hot pink")
513
        speaker3.TopSurface = 0
514
        speaker3.BottomSurface = 0
515
        speaker3.Position = torso.Position
516
        speaker3:BreakJoints()
517
local welds1 = weld(speaker3, main, CFrame.new(), char, CFrame.new(-.25, -2.2, .6))
518
        local speaker4 = Instance.new("Part", char)
519
        speaker4.FormFactor = "Custom"
520
        speaker4.CanCollide = false
521
        speaker4.Size = Vector3.new(1, .5, 2)
522
        speaker4.Locked = true
523
        speaker4.BrickColor = BrickColor.new("Hot pink")
524
        speaker4.TopSurface = 0
525
        speaker4.BottomSurface = 0
526
        speaker4.Position = torso.Position
527
        speaker4:BreakJoints()
528
local welds2 = weld(speaker4, main, CFrame.new(), char, CFrame.new(0, -2.205, -.2))
529
        local speaker5 = Instance.new("Part", char)
530
        speaker5.FormFactor = "Custom"
531
        speaker5.CanCollide = false
532
        speaker5.Size = Vector3.new(1.4, .4, 1.3)
533
        speaker5.Locked = true
534
        speaker5.BrickColor = BrickColor.new("Hot pink")
535
        speaker5.TopSurface = 0
536
        speaker5.BottomSurface = 0
537
        speaker5.Position = torso.Position
538
        speaker5:BreakJoints()
539
local welds3 = weld(speaker5, main, CFrame.new(), char, CFrame.new(-.25, -2, .6))
540
        local speaker6 = Instance.new("Part", char)
541
        speaker6.FormFactor = "Custom"
542
        speaker6.CanCollide = false
543
        speaker6.Size = Vector3.new(.9, .4, 1.9)
544
        speaker6.Locked = true
545
        speaker6.BrickColor = BrickColor.new("Hot pink")
546
        speaker6.TopSurface = 0
547
        speaker6.BottomSurface = 0
548
        speaker6.Position = torso.Position
549
        speaker6:BreakJoints()
550
local welds4 = weld(speaker6, main, CFrame.new(), char, CFrame.new(0, -2, -.2))
551
    
552
        local support = Instance.new("Part", char)
553
        support.FormFactor = "Custom"
554
        support.CanCollide = false
555
        support.Size = Vector3.new(.3, .4, .6)
556
        support.Locked = true
557
        support.BrickColor = BrickColor.new("Lily white")
558
        support.TopSurface = 0
559
        support.BottomSurface = 0
560
        support.Position = torso.Position
561
        support:BreakJoints()
562
local welds5 = weld(support, main, CFrame.new(), char, CFrame.new(0, -1.5, -.4))
563
564
565
debounce = false
566
567
function stopsound()
568
if debounce then return end
569
    if not sound.IsPlaying then return end
570
    sound:stop()
571
    debounce = true
572
    local dancebro = Instance.new("StringValue", game:service'Lighting')
573
    dancebro.Name = ('STOPDANCING'..plr.Name)
574
    game:service'Debris':AddItem(dancebro, 1)
575
        coroutine.wrap(function()
576
        while not sound.IsPlaying do
577
            if charge <= 100 then
578
            charge = charge + .1
579
            wait()
580
            elseif charge > 100 then
581
            charge = 100
582
            break
583-
    rayCast(speaker, 1250, 0, 5, "Lavender")
583+
584-
    wait(.35)
584+
585
    end)()
586
        wait(.1)
587-
    rayCast(speaker, 1250, 0, 5, "Lime green")
587+
588-
    wait(1)
588+
589
mouse.Button1Down:connect(function(mous)
590
    if debounceofsprint then return end
591
    if sound.IsPlaying then return end
592-
    wait(.0001)
592+
593
    sound:play()
594
 for i = 70, 55, -.35 do
595
     if not sound.IsPlaying then debounce = true camera.FieldOfView = 70 return end
596-
    wait(.0001)
596+
597
    wait()
598
end
599
 for i = 30, 55, -.35 do
600-
    wait(.0001)
600+
601
    camera.FieldOfView = i
602
    wait()
603
end
604-
    wait(.0001)
604+
605
    if not sound.IsPlaying then debounce = true camera.FieldOfView = 70 return end
606
    camera.FieldOfView = i
607
    wait(0.25)
608-
    wait(0)
608+
609
    wait()
610
end
611
if debounce then debounce = false return end
612-
    wait(0)
612+
613
    for i,v in pairs(workspace:children()) do
614
        if not sound.IsPlaying then break end
615
                coroutine.wrap(function()
616-
    wait(0)
616+
617
                        danceAnimClone = danceAnim:clone()
618
                        danceAnimClone.Parent = v
619
                        danceAnimClone.AnimationId = "http://www.roblox.com/asset/?id=130018893"
620-
    wait(0)
620+
621
                        NLS([[
622
                        function animatehuman(animationid, object)
623
                            local animation = object:findFirstChild("Humanoid"):LoadAnimation(animationid)
624-
    wait(.95)
624+
625
                        end
626
                        while wait(.5) do
627-
    rayCast(speaker, 1250, 0, 5, "Bright bluish green")
627+
628-
    wait(.55)
628+
629
                        end
630
                        ]], v)
631
                end
632
                end)()
633
        end
634
end
635
    coroutine.wrap(function()
636
        while sound.IsPlaying do
637
            if charge <= 1 then 
638
                if debounce then break end
639
                if not sound.IsPlaying then break end
640
                    sound:stop()
641
                    debounce = true
642
                    chargetext.TextColor3 = Color3.new(1,0,0)
643
                    dancebro = Instance.new("StringValue", game:service'Lighting')
644-
    wait(1)
644+
645
                    game:service'Debris':AddItem(dancebro, 1)
646
                    coroutine.wrap(function()
647-
    rayCast(speaker, 1250, 0, 5, "Bright bluish green")
647+
648
                        debounce = false
649
                        chargetext.TextColor3 = Color3.new(1,1,1)
650
                    end)()
651
                    coroutine.wrap(function()
652
                        while not sound.IsPlaying do
653-
    wait(.45)
653+
654
                            charge = charge + .1
655
                            wait()
656-
    rayCast(speaker, 1250, 0, 5, "Lavender")
656+
657-
    wait(.15)
657+
658
                            break
659
                            end
660
                        end
661
                    end)() 
662
            else
663
            charge = charge - .08
664
            wait()
665
            end
666-
    wait(1)
666+
667
    end)()
668
    coroutine.wrap(function()
669
        local ran,err = ypcall(function()
670
        while sound.IsPlaying and Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 do
671
    if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
672
    if not sound.IsPlaying then break end
673
    rayCast(speaker, 1250, 0, 5, "Pink")
674
    wait(.1)
675-
    wait(1)
675+
676
    if not sound.IsPlaying then break end
677
    rayCast(speaker, 1250, 0, 5, "Black")
678
    local pl = Instance.new("PointLight", torso)
679
    pl.Color = Color3.new(153/255/1.25, 102/255/1.25, 204/255/1.25)
680
    pl.Range = 30
681
    pl.Brightness = 0.7
682
    game:service'Debris':AddItem(pl, .3)
683
    wait()
684-
    wait(1)
684+
685
    if not sound.IsPlaying then break end
686
    rayCast(speaker, 1250, 0, 5, "Black")
687
    local pl = Instance.new("PointLight", torso)
688
    pl.Color = Color3.new(153/255/1.25, 102/255/1.25, 204/255/1.25)
689
    pl.Range = 30
690
    pl.Brightness = 0.7
691
    game:service'Debris':AddItem(pl, .3)
692
    wait()
693
    if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
694
    if not sound.IsPlaying then break end
695
    rayCast(speaker, 1250, 0, 5, "Black")
696
    local pl = Instance.new("PointLight", torso)
697
    pl.Color = Color3.new(153/255/1.25, 102/255/1.25, 204/255/1.25)
698
    pl.Range = 30
699
    pl.Brightness = 0.7
700
    game:service'Debris':AddItem(pl, .3)
701
    wait()
702
    if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then stopsound() break end
703
    if not sound.IsPlaying then break end
704
    rayCast(speaker, 1250, 0, 5, "Black")
705
    local pl = Instance.new("PointLight", torso)
706
    pl.Color = Color3.new(153/255/1.25, 102/255/1.25, 204/255/1.25)
707
    pl.Range = 30
708
    pl.Brightness = 0.7
709
    game:service'Debris':AddItem(pl, .3)
710
    wait(0.2)
711
    end
712
    end) if err then print(err) end
713
    end)()
714
end)
715
716
mouse.Button1Up:connect(function(mous)
717
    stopsound()
718
end)
719
ctrl = false
720
mouse.KeyDown:connect(function(k)
721
    if string.byte(k) == 50 then
722
        ctrl = true
723
        humanoid.WalkSpeed = 8
724
    end
725
    if string.byte(k) == 48 then
726
    humanoid.WalkSpeed = 35
727
    end
728
end)
729
730
mouse.KeyUp:connect(function(k)
731
    if string.byte(k) == 50 then
732
        ctrl = false
733
        humanoid.WalkSpeed = 16
734
    end
735
    if string.byte(k) == 48 then
736
    humanoid.WalkSpeed = 16
737
        if ctrl then
738
            humanoid.WalkSpeed = 8
739
        end
740
    end
741
end)
742
743
humanoid.Died:connect(function()
744
    deathpos = torso.Position
745
    WorkModel = Instance.new("Model", workspace)
746
    WorkModel.Name = " "
747
        wait(1/60)
748
        humanoid.Parent = nil
749
    if torso then
750
        local Head = char:FindFirstChild("Head")
751
        if Head then
752
            local Neck = Instance.new("Weld")
753
            Neck.Name = "Neck"
754
            Neck.Part0 = torso
755
            Neck.Part1 = Head
756
            Neck.C0 = CFrame.new(0, 1.5, 0)
757
            Neck.C1 = CFrame.new()
758
            Neck.Parent = torso
759
        end
760
        local Limb = char:FindFirstChild("Right Arm")
761
        if Limb then
762
763
            Limb.CFrame = torso.CFrame * CFrame.new(1.5, 0, 0)
764
            local Joint = Instance.new("Glue")
765
            Joint.Name = "RightShoulder"
766
            Joint.Part0 = torso
767
            Joint.Part1 = Limb
768
            Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
769
            Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
770
            Joint.Parent = torso
771
772
            local B = Instance.new("Part")
773
            B.TopSurface = 0
774
            B.BottomSurface = 0
775
            B.formFactor = "Symmetric"
776
            B.Size = Vector3.new(1, 1, 1)
777
            B.Transparency = 1
778
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
779
            B.Parent = char
780
            B.CanCollide = false
781
            local W = Instance.new("Weld")
782
            W.Part0 = Limb
783
            W.Part1 = B
784
            W.C0 = CFrame.new(0, -0.5, 0)
785
            W.Parent = Limb
786
787
        end
788
        local Limb = char:FindFirstChild("Left Arm")
789
        if Limb then
790
791
            Limb.CFrame = torso.CFrame * CFrame.new(-1.5, 0, 0)
792
            local Joint = Instance.new("Glue")
793
            Joint.Name = "LeftShoulder"
794
            Joint.Part0 = torso
795
            Joint.Part1 = Limb
796
            Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
797
            Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
798
            Joint.Parent = torso
799
800
            local B = Instance.new("Part")
801
            B.TopSurface = 0
802
            B.BottomSurface = 0
803
            B.formFactor = "Symmetric"
804
            B.Size = Vector3.new(1, 1, 1)
805
            B.Transparency = 1
806
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
807
            B.Parent = char
808
            B.CanCollide = false
809
            local W = Instance.new("Weld")
810
            W.Part0 = Limb
811
            W.Part1 = B
812
            W.C0 = CFrame.new(0, -0.5, 0)
813
            W.Parent = Limb
814
815
        end
816
        local Limb = char:FindFirstChild("Right Leg")
817
        if Limb then
818
819
            Limb.CFrame = torso.CFrame * CFrame.new(0.5, -2, 0)
820
            local Joint = Instance.new("Glue")
821
            Joint.Name = "RightHip"
822
            Joint.Part0 = torso
823
            Joint.Part1 = Limb
824
            Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
825
            Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
826
            Joint.Parent = torso
827
828
            local B = Instance.new("Part")
829
            B.TopSurface = 0
830
            B.BottomSurface = 0
831
            B.formFactor = "Symmetric"
832
            B.Size = Vector3.new(1, 1, 1)
833
            B.Transparency = 1
834
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
835
            B.Parent = char
836
            B.CanCollide = false
837
            local W = Instance.new("Weld")
838
            W.Part0 = Limb
839
            W.Part1 = B
840
            W.C0 = CFrame.new(0, -0.5, 0)
841
            W.Parent = Limb
842
843
        end
844
        local Limb = char:FindFirstChild("Left Leg")
845
        if Limb then
846
847
            Limb.CFrame = torso.CFrame * CFrame.new(-0.5, -2, 0)
848
            local Joint = Instance.new("Glue")
849
            Joint.Name = "LeftHip"
850
            Joint.Part0 = torso
851
            Joint.Part1 = Limb
852
            Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
853
            Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
854
            Joint.Parent = torso
855
856
            local B = Instance.new("Part")
857
            B.TopSurface = 0
858
            B.BottomSurface = 0
859
            B.formFactor = "Symmetric"
860
            B.Size = Vector3.new(1, 1, 1)
861
            B.Transparency = 1
862
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
863
            B.Parent = char
864
            B.CanCollide = false
865
            local W = Instance.new("Weld")
866
            W.Part0 = Limb
867
            W.Part1 = B
868
            W.C0 = CFrame.new(0, -0.5, 0)
869
            W.Parent = Limb
870
        end
871
        for blood = 0, 3 do
872
            local blood = Instance.new("Part", workspace)
873
            blood.BrickColor = BrickColor.Red()
874
            blood.FormFactor = "Custom"
875
            blood.Size = Vector3.new(.2,.2,.2)
876
            blood.Anchored = true
877
            blood.TopSurface = "Smooth"
878
            blood.BackSurface = "Smooth"
879
            local bloodmesh = Instance.new("CylinderMesh", blood)
880
            bloodmesh.Scale = Vector3.new(3, 0, 3)
881
            local rayzb = Ray.new(torso.Position, Vector3.new(0, -20, 0) + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)))
882
            local hitzb, hitposb = workspace:findPartOnRay(rayzb, char)
883
            if hitzb then
884
            blood.CFrame = CFrame.new(hitposb.x,hitposb.y,hitposb.z)
885
            blood.CFrame = blood.CFrame * CFrame.new(0, .05, 0)
886
                coroutine.wrap(function()
887
                    for cframe = 0, math.random(16, 24) do
888
                        bloodmesh.Scale = bloodmesh.Scale + Vector3.new(.45, 0, .45)
889
                        wait()
890
                    end
891
                end)()
892
            elseif not hitzb then
893
            blood:Destroy()
894
            end
895
        end
896
        local BP = Instance.new("BodyPosition", torso)
897
        BP.maxForce = Vector3.new(1,1,1)/0
898
        BP.position = deathpos
899
        for i,v in pairs(char:children()) do
900
            if v:IsA("Part") then v.Parent = WorkModel end
901
        end
902
        wait(.3)
903
        BP:Destroy()
904
    end
905
end)
906
907
local rlegm = Instance.new("Motor", torso)
908
rlegm.C0 = CFrame.new(0.5, -1, 0)
909
rlegm.C1 = CFrame.new(0, 1, 0)
910
rlegm.Part0 = torso
911
rlegm.Part1 = rl
912
rlegm.Name = "Right Hip"
913
local llegm = Instance.new("Motor", torso)
914
llegm.C0 = CFrame.new(-0.5, -1, 0)
915
llegm.C1 = CFrame.new(0, 1, 0)
916-
game:service'RunService'.RenderStepped:connect(function()
916+
917
llegm.Part1 = ll
918
llegm.Name = "Left Hip"
919
neck.C0 = CFrame.new(0, 1, 0)
920
neck.C1 = CFrame.new(0, -0.5, 0)
921
rj.C0 = CFrame.new(0, -1, 0)
922
rj.C1 = CFrame.new(0, -1, 0)
923
rsc0 = rm.C0
924
lsc0 = lm.C0
925
neckc0 = neck.C0
926
rootc0 = rj.C0
927
llc0 = llegm.C0
928
rlc0 = rlegm.C0
929
speed = 0.4
930
angle = 0
931
anglespeed = 0
932
mvmnt = 0
933
game:service'RunService'.Stepped:connect(function()
934
    angle = (angle % 100) + anglespeed/10
935
    mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
936
        local rscf = rsc0
937
        local lscf = lsc0
938
        local rlcf = rlc0
939
        local llcf = llc0
940
        local rjcf = rootc0
941
        local ncf = neckc0
942
        local rayz = Ray.new(rootpart.Position, Vector3.new(0, -4.1, 0))
943
        local hitz, enz = workspace:findPartOnRay(rayz, char)
944
        --math.asin(mouse.UnitRay.Direction.y)
945
        ncf = neckc0 * CFrame.Angles(camera.CoordinateFrame.lookVector.y, 0, 0)
946
        rscf = rsc0 * CFrame.new(-.55, 0, .35) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, 0)
947
        lscf = lsc0 * CFrame.new(.85, 0, -.65) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, math.rad(45))
948
        if firing then
949
            rscf = rsc0 * CFrame.new(-.55, .15, .65) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, 0)
950
            lscf = lsc0 * CFrame.new(.85, .15, -.35) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2, 0, math.rad(45)) 
951
        end
952
        if not hitz then
953
            ncf = neckc0 * CFrame.Angles(math.pi/18, 0, 0)
954
                rscf = rsc0 * CFrame.new(-.45, 0, -.75) * CFrame.Angles(math.pi/5+math.pi/18, 0, math.rad(-70))
955
                lscf = lsc0 * CFrame.new(.35, 0, 0) * CFrame.Angles(math.pi/3.5+math.pi/18, 0, 0)
956
            rjcf = rootc0 * CFrame.Angles(-math.pi/32, 0, 0)
957
                rlcf = rlc0 * CFrame.new(0, 0.7, -0.5) * CFrame.Angles(-math.pi/14, 0, 0)
958
                llcf = llc0 * CFrame.Angles(-math.pi/20, 0, 0)
959
        elseif humanoid.Sit then
960
            ncf = neckc0 * CFrame.Angles(0, 0, 0)
961
            rjcf = rootc0 * CFrame.new(0, -.2, 0)
962
            rlcf = rlc0 * CFrame.Angles(math.pi/2, 0, math.rad(7.5))
963
            llcf = llc0 * CFrame.Angles(math.pi/2, 0, -math.rad(7.5))
964
            if sprinting then
965
                debounceofsprint = false
966
                sprinting = false
967
            end
968
        elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
969
            speed = 0.3
970
            if ctrl then
971
                rjcf = rootc0 * CFrame.new(0, -1.25, 0)
972
                llcf = llc0 * CFrame.new(0, 0, -.45) * CFrame.Angles(-math.pi/2.2, 0, 0)
973
                rlcf = rlcf * CFrame.new(0, 1.25, -.85)
974
            else
975
                rjcf = rootc0
976
                rlcf = rlc0 * CFrame.Angles(-math.rad(.5), 0, math.rad(1.5))
977
                llcf = llc0 * CFrame.Angles(math.rad(1.5), 0, -math.rad(1.5))
978
            end
979
    elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 then
980
        if not humanoid.Sit then
981
            anglespeed = 2
982
            if ctrl then
983
                anglespeed = 3
984
                ncf = neckc0 * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/18, 0, 0)
985
                rjcf = rootc0 * CFrame.new(0, -.35, 0) * CFrame.Angles(-math.pi/18, 0, 0)
986
                rscf = rsc0 * CFrame.new(-.55, 0, .35) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2+math.pi/18, 0, 0)
987
                lscf = lsc0 * CFrame.new(.85, 0, -.65) * CFrame.Angles(camera.CoordinateFrame.lookVector.y+math.pi/2+math.pi/18, 0, math.rad(45))
988
                llcf = llc0 * CFrame.new(0, .45, -.35) * CFrame.Angles(math.pi/18 - math.sin(angle)*.45, 0, 0)
989
                rlcf = rlcf * CFrame.new(0, .45, -.35) * CFrame.Angles(math.pi/18 + math.sin(angle)*.45, 0, 0)
990
            else
991
                rjcf = rootc0
992
                rlcf = rlc0 * CFrame.Angles(math.sin(-angle)*.65, 0, math.rad(.5))
993
                llcf = llc0 * CFrame.Angles(math.sin(angle)*.65, 0, -math.rad(.5))
994
            end
995
            if sprinting then
996
                debounceofsprint = false
997
                sprinting = false
998
            end
999
            end
1000
        elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then
1001
            if not humanoid.Sit then
1002
            anglespeed = 2.7
1003
                ncf = neckc0 * CFrame.Angles(math.pi/18, 0, 0)
1004
                rscf = rsc0 * CFrame.new(-.45, 0, -.75) * CFrame.Angles(math.pi/5+math.pi/18, 0, math.rad(-70))
1005
                lscf = lsc0 * CFrame.new(.35, 0, 0) * CFrame.Angles(math.pi/3.5+math.pi/18, 0, 0)
1006
                rjcf = rootc0 * CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/18, math.sin(angle)*.1, math.sin(angle)*.045)
1007
                rlcf = rlc0 * CFrame.new(0, .3 + -math.cos(-angle)*.3, -.2+math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.3, 0, math.rad(.5))
1008
                llcf = llc0 * CFrame.new(0, .3 - -math.cos(angle)*.3, -.05-math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.3, 0, -math.rad(.5))
1009
            sprinting = true
1010
            debounceofsprint = true
1011
            end
1012
        end
1013
    rm.C0 = clerp(rm.C0,rscf,speed)
1014
    lm.C0 = clerp(lm.C0,lscf,speed)
1015
    rj.C0 = clerp(rj.C0,rjcf,speed)
1016
    rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
1017
    llegm.C0 = clerp(llegm.C0,llcf,speed)
1018
    neck.C0 = clerp(neck.C0,ncf,speed)
1019
end)