View difference between Paste ID: LRgQSURz and aUB3qNH3
SHOW: | | - or go back to the newest paste.
1
local plr = game.Players.LocalPlayer
2
local char = plr.Character
3
local mouse = plr:GetMouse()
4
local torso = char.Torso
5
local head = char.Head
6
local ra = char["Right Arm"]
7
local la = char["Left Arm"]
8
local rl = char["Right Leg"]
9
local ll = char["Left Leg"]
10
local human = char["Humanoid"]
11
local camera = workspace.CurrentCamera
12
local rs = torso:findFirstChild("Right Shoulder")
13
local ls = torso:findFirstChild("Left Shoulder")
14
local neck = torso:findFirstChild("Neck")
15
local NO_moar_shooting = false
16
local RunService = game:service'RunService'
17
local ammo = 999999999999
18
19
20
local sound = Instance.new("Sound", head)
21
sound.SoundId = "http://roblox.com/asset/?id=11944350"
22
sound.Volume = 1
23
local reloads = Instance.new("Sound", head)
24
reloads.SoundId = "http://roblox.com/asset/?id=106626233"
25
reloads.Volume = 1
26
local activate = Instance.new("Sound", head)
27
activate.SoundId = "http://roblox.com/asset/?id=106626233"
28
activate.Volume = 1
29
30
31
local equipped = false
32
33
local debounce = false
34
35
local face = head.face
36
37
38
release = Instance.new("Part", nil)
39
release.FormFactor = "Custom"
40
release.Size = Vector3.new(0.0, 0.0, 0.0)
41
release.BrickColor = BrickColor.Black()
42
local weld = Instance.new("Weld", release)
43
weld.Part0 = release
44
release.Locked = true
45
weld.Part1 = head
46
weld.C0 = CFrame.new(0, -0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
47
local mesh = Instance.new("CylinderMesh", release)
48
49
release2 = Instance.new("Part", nil)
50
release2.FormFactor = "Custom"
51
release2.Size = Vector3.new(0.0, 0.0, 0.0)
52
release2.BrickColor = BrickColor.Black()
53
release2.Locked = true
54
local weld2 = Instance.new("Weld", release2)
55
weld2.Part0 = release2
56
weld2.Part1 = head
57
weld2.C0 = CFrame.new(0, -0.5, 0) * CFrame.Angles(math.pi/2, 0, 0)
58
local mesh2 = Instance.new("CylinderMesh", release2)
59
60
headext = Instance.new("Part", nil)
61
headext.Position = torso.Position
62
headext.FormFactor = "Custom"
63
headext.Transparency = 1
64
headext:BreakJoints()
65
headext.Size = Vector3.new(2, 1, 1)
66
headextw = Instance.new("Weld", headext)
67
headextw.C0 = CFrame.new(Vector3.new(0, 1.5, 0))
68
headextw.Part0 = torso
69
headextw.Part1 = headext
70
headextw.C1 = CFrame.new()
71
headweld = Instance.new("Weld", headext)
72
game:service("RunService").Stepped:connect(function()
73
           headweld.C0 = CFrame.new(Vector3.new(0,0,0), torso.CFrame:pointToObjectSpace(mouse.Hit.p)) * CFrame.Angles(0, 0, 0)
74
end)
75
headweld.Part0 = headext
76
headweld.C1 = CFrame.new()
77
headweld.Part1 = head
78
79
local Screen = Instance.new("ScreenGui", plr:findFirstChild("PlayerGui"))
80
local TextBox = Instance.new("TextLabel", Screen)
81
TextBox.Position = UDim2.new(0.1, 0, 0.95, 0)
82
TextBox.Size = UDim2.new(0, 200, 0.05, 0)
83
TextBox.BackgroundTransparency = 1
84
game:service'RunService'.Stepped:connect(function()
85
TextBox.Text = ("Ammo: "..ammo)
86
end)
87
TextBox.Font = "SourceSansBold"
88
TextBox.TextColor3 = Color3.new(1, 1, 1)
89
TextBox.FontSize = "Size36"
90
TextBox.TextStrokeTransparency = 0
91
92
local pl = Instance.new("PointLight", release)
93
pl.Range = 16
94
pl.Brightness = 5
95
pl.Color = Color3.new(1, 199/255, 67/255)
96
pl.Enabled = false
97
function reload()
98
	if ammo > 7 then return end
99
		reloads:play()
100
		ammo = ammo + 1
101
	activate:play()
102
	wait(0.3)
103
	debounce = false
104
end
105
106
mouse.KeyDown:connect(function(key)
107
	if key == "r" then
108
		if debounce then return end
109
		if not equipped then return end
110
		if ammo > 7 then return end
111
		debounce = true
112
		reload()
113
	end
114
	
115
	if key == "q" then
116
		equipped = not equipped
117
		if equipped then
118
			headext.Parent = char
119
			release.Parent = char
120
			release2.Parent = char
121
			for scale = 0, 1, 0.2 do
122
				weld2.C0 = CFrame.new(0, -scale + 0.5, 0) * CFrame.Angles(math.pi/2, 0, 0)
123
				weld.C0 = CFrame.new(0, -scale + 0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
124
				mesh.Scale = Vector3.new(1, scale, 1)
125
				mesh2.Scale = Vector3.new(1, scale, 1)
126
				wait()
127
				end
128
		else
129
			face.Parent = head
130
			release.Parent = nil
131
			release2.Parent = nil
132
			headext.Parent = nil
133
		end
134
	end
135
end)
136
137
mouse.Button1Down:connect(function()
138
	if not equipped then return end
139
	if ammo < 1 then return end
140
			if debounce then return end
141
			debounce = true
142
			sound:play()
143
			pl.Enabled = true
144
			ammo = ammo - 1
145
			coroutine.wrap(function()
146
				wait(0.07)
147
				pl.Enabled = false
148
				end)()
149
			coroutine.wrap(function()
150
				for scale = 0.7, 1, 0.1 do
151
					mesh.Scale = Vector3.new(1, scale, 1)
152
					wait()
153
				end
154
			end)()
155
			
156
			for bullet = 0, 5 do
157
				coroutine.wrap(function()
158
	if char.Humanoid.Health < 1 then return end
159
    local rayPart         = Instance.new("Part")
160
    rayPart.Name          = "RayPart"
161
    rayPart.BrickColor    = BrickColor.Green()
162
    rayPart.Anchored      = true
163
    rayPart.CanCollide    = false
164
	rayPart.Locked = true
165
    rayPart.TopSurface    = Enum.SurfaceType.Smooth
166
    rayPart.BottomSurface = Enum.SurfaceType.Smooth
167
    rayPart.formFactor    = Enum.FormFactor.Custom
168
    rayPart.Size          = Vector3.new(0.2, 0.2, 4)
169
			Instance.new("BlockMesh", rayPart).Scale = Vector3.new(0.2, 0.2, 0.5)
170
	
171
	
172
	
173
    local bulletposition = release.Position
174
   local bulletvelocity = (Vector3.new(math.random(-7,7), math.random(-7,7), math.random(-7,7)))+( mouse.Hit.p - bulletposition).unit*150
175
    local bulletlastposition = bulletposition
176
    rayPart.CFrame = CFrame.new( bulletposition, bulletposition+bulletvelocity )
177
178
179
180
181
    
182
    coroutine.resume(coroutine.create(function()
183
        while true do
184
	        local dt = wait()
185
            bulletlastposition = bulletposition
186
            bulletvelocity = bulletvelocity + (Vector3.new(0, -9.81*10, 0)*dt)
187
	        bulletposition = bulletposition + (bulletvelocity*dt)
188
	rayPart.Parent = workspace
189
                
190
            local ray = Ray.new(bulletlastposition,  (bulletposition - bulletlastposition))
191
            local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayPart} )
192
	            
193
	if (torso.Position - rayPart.Position).magnitude > 440 then
194
	 	rayPart:Destroy()
195
	 break
196
	 end
197
	
198
	
199
            if hit then
200
	local damage = math.random(9999999, 99999999)
201
				if hit.Parent:findFirstChild("Humanoid") ~= nil then
202
					hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
203
					    coroutine.wrap(function()
204
        local prt = Instance.new("Part", char)
205
        prt.FormFactor = "Custom"
206
        prt.Size = Vector3.new(0.1, 0.1, 0.1)
207
        prt.Transparency = 1
208
        prt.CanCollide = false
209
        prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
210
        prt.Anchored = true
211
        coroutine.resume(coroutine.create(function()
212
                        for i = 2, 10, 0.1 do
213
                                if prt == nil then return end
214
                        prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
215
                        game:service'RunService'.Stepped:wait()
216
                        end
217
        end))
218
        
219
local bg = Instance.new("BillboardGui")
220
bg.Parent = prt
221
bg.Adornee = prt
222
bg.Size = UDim2.new(4, 0, 3.5, 0)
223
bg.ExtentsOffset = Vector3.new(0, 0, 0)
224
local lol = Instance.new("TextLabel")
225
lol.Size = UDim2.new(1.3, 0, 0.4, 0)
226
lol.TextScaled = true
227
lol.TextWrapped = true
228
lol.BackgroundTransparency = 1
229
lol.Parent = bg
230
lol.FontSize = "Size24"
231
lol.TextColor3 = Color3.new(1, 0, 0)
232
lol.TextStrokeTransparency = 0
233
lol.Font = "ArialBold"
234
lol.Text = "-"..damage
235
        
236
wait(3)
237
prt:Destroy()
238
end)()
239
				end
240
				if hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then
241
					hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage
242
										    coroutine.wrap(function()
243
        local prt = Instance.new("Part", char)
244
        prt.FormFactor = "Custom"
245
        prt.Size = Vector3.new(0.1, 0.1, 0.1)
246
        prt.Transparency = 1
247
        prt.CanCollide = false
248
        prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
249
        prt.Anchored = true
250
        coroutine.resume(coroutine.create(function()
251
                        for i = 2, 10, 0.1 do
252
                                if prt == nil then return end
253
                        prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
254
                        game:service'RunService'.Stepped:wait()
255
                        end
256
        end))
257
        
258
local bg = Instance.new("BillboardGui")
259
bg.Parent = prt
260
bg.Adornee = prt
261
bg.Size = UDim2.new(4, 0, 3.5, 0)
262
bg.ExtentsOffset = Vector3.new(0, 0, 0)
263
local lol = Instance.new("TextLabel")
264
lol.Size = UDim2.new(1.3, 0, 0.4, 0)
265
lol.TextScaled = true
266
lol.TextWrapped = true
267
lol.BackgroundTransparency = 1
268
lol.Parent = bg
269
lol.FontSize = "Size24"
270
lol.TextColor3 = Color3.new(1, 0, 0)
271
lol.TextStrokeTransparency = 0
272
lol.Font = "ArialBold"
273
lol.Text = "-"..damage
274
        
275
wait(3)
276
prt:Destroy()
277
end)()
278
					end
279
                bulletposition = hitposition
280
                rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
281
                rayPart:Destroy()
282
                break
283
            end
284
	        rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
285
        end
286
    end))
287
				end)()
288
				end
289
		wait(0.3)
290
			debounce = false
291
		
292-
end)
292+
293
caninfect = true
294
invisible = false
295
function targettool()
296
	local torso = mouse.Target.Parent:findFirstChild("Torso")
297
	local humanoid = mouse.Target.Parent:findFirstChild("Humanoid")
298
	if torso and humanoid then
299
		target = torso
300
		print("You are now targetting "..torso.Parent.Name)
301
	end
302
end
303
mouse.Button1Down:connect(targettool)
304
function inv(key)
305
	if key == "q" then
306
		invisible = not invisible
307
		if invisible then
308
			game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 40
309
			for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
310
				if v.ClassName == "Part" then
311
					if v.Name == "HumanoidRootPart" then
312
						
313
					else
314
						v.Transparency = 1
315
					end
316
				end
317
				game.Players.LocalPlayer.Character.Head.face.Transparency = 1
318
				for q,w in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
319
					if w.ClassName == "Shirt Graphic" then
320
						w.Graphic = "rbxassetid://0"
321
					end
322
				end
323
				for e,r in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
324
					if r.ClassName == "Accessory" or r.ClassName == "Hat" then
325
						r.Handle.Transparency = 1
326
					end
327
				end
328
			end
329
		end
330
		if not invisible then
331
			game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
332
			for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
333
				if v.ClassName == "Part" then
334
					if v.Name == "HumanoidRootPart" then
335
						
336
					else
337
						v.Transparency = 0
338
					end
339
				end
340
				game.Players.LocalPlayer.Character.Head.face.Transparency = 0
341
				for q,w in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
342
					if w.ClassName == "Shirt Graphic" then
343
						w.Graphic = graphicid
344
					end
345
				end
346
				for e,r in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
347
					if r.ClassName == "Accessory" or r.ClassName == "Hat" then
348
						r.Handle.Transparency = 0
349
					end
350
				end
351
			end
352
		end
353
	end
354
end
355
mouse.KeyDown:connect(inv)
356
function zawmbie(part)
357
	if part.Parent then
358
		torso = part.Parent:findFirstChild("Torso")
359
		humanoid = part.Parent:findFirstChild("Humanoid")
360
	end
361
	if caninfect and torso and humanoid ~= nil and part.Parent ~= nil then
362
		if torso.Parent.Name == "Infected Player" then
363
			--nono
364
		else
365
			torso.Parent.Archivable = true
366
			local zombieclone = torso.Parent:Clone()
367
			zombieclone.Name = "Infected Player"
368
			torso.Anchored = true
369
			humanoid.Health = 0
370
			for i,v in pairs(torso.Parent:GetChildren()) do
371
				if v.ClassName == "Part" then
372
					v.CFrame = v.CFrame * CFrame.new(0,50,0)
373
					v.Anchored = true
374
					v.Transparency = 1
375
				end
376
				if v.ClassName == "Hat" or v.ClassName == "Accessory" then
377
					v:destroy()
378
				end
379
			end
380
			local infectionsound = Instance.new("Sound", torso.Parent.Head)
381
			infectionsound.SoundId = "rbxassetid://130976109"
382
			infectionsound.Volume = 10
383
			infectionsound:Play()
384
			zombieclone.Parent = workspace
385
			local function die()
386
				wait(5)
387
				zombieclone:destroy()
388
			end
389
			zombieclone.Humanoid.Died:connect(die)
390
			local face = zombieclone.Head:findFirstChild("face")
391
			if face ~= nil then
392
				face.Texture = "rbxassetid://19986263"
393
			end
394
			zombieclone.Torso.CFrame = zombieclone.Torso.CFrame * CFrame.new(4,0,4)
395
			zombieclone.Humanoid.MaxHealth = humanoid.MaxHealth * 2
396
			zombieclone.Humanoid.Health = zombieclone.Humanoid.MaxHealth
397
			zombieclone.Humanoid.WalkSpeed = 1
398
			local rarmfornow = zombieclone.Torso:findFirstChild("Right Shoulder")
399
			local larmfornow = zombieclone.Torso:findFirstChild("Left Shoulder")
400
			if rarmfornow ~= nil then
401
				for i = 1,2 do
402
					wait()
403
					rarmfornow.C0 = rarmfornow.C0 * CFrame.Angles(0,0,0.09)
404
				end
405
				for i = 1,3 do
406
					wait()
407
					rarmfornow.C0 = rarmfornow.C0 * CFrame.Angles(0,0,0.11)
408
				end
409
				for i = 1,6 do
410
					wait()
411
					rarmfornow.C0 = rarmfornow.C0 * CFrame.Angles(0,0,0.12)
412
				end
413
				for i = 1,3 do
414
					wait()
415
					rarmfornow.C0 = rarmfornow.C0 * CFrame.Angles(0,0,0.11)
416
				end
417
				for i = 1,2 do
418
					wait()
419
					rarmfornow.C0 = rarmfornow.C0 * CFrame.Angles(0,0,0.09)
420
				end
421
			end
422
			if larmfornow ~= nil then
423
				for i = 1,2 do
424
					wait()
425
					larmfornow.C0 = larmfornow.C0 * CFrame.Angles(0,0,-0.09)
426
				end
427
				for i = 1,3 do
428
					wait()
429
					larmfornow.C0 = larmfornow.C0 * CFrame.Angles(0,0,-0.11)
430
				end
431
				for i = 1,6 do
432
					wait()
433
					larmfornow.C0 = larmfornow.C0 * CFrame.Angles(0,0,-0.12)
434
				end
435
				for i = 1,3 do
436
					wait()
437
					larmfornow.C0 = larmfornow.C0 * CFrame.Angles(0,0,-0.11)
438
				end
439
				for i = 1,2 do
440
					wait()
441
					larmfornow.C0 = larmfornow.C0 * CFrame.Angles(0,0,-0.09)
442
				end
443
			end
444
			wait(3)
445
			zombieclone.Torso.Touched:connect(zawmbie)
446
			canchange = true
447
			function change()
448
				if canchange then
449
					canchange = false
450
					ply = game.Players:GetPlayers()[math.random(game.Players.NumPlayers)]
451
					local plytorso = ply.Character:findFirstChild("Torso")
452
					local plyhumanoid = ply.Character:findFirstChild("Humanoid")
453
					if ply.Name == game.Players.LocalPlayer.Name or not plyhumanoid or not plytorso or plytorso.Transparency == 1 then
454
						change()
455
					else
456
						target = ply.Character.Torso
457
						print(target.Parent.Name)
458
					end
459
					wait(5)
460
					canchange = true
461
				end
462
			end
463
			zombieclone.Torso.Touched:connect(change)
464
			while true do
465
				wait()
466
				for i,v in pairs(game.Players:GetChildren()) do
467
					local char = v:findFirstChild("Character")
468
					if char ~= nil then
469
						local ws = v.Character:findFirstChild("Humanoid")
470
						if ws ~= nil then
471
							if ws.WalkSpeed >= 41 then
472
								ws.WalkSpeed = 16
473
							end
474
						end
475
					end
476
				end
477
				local targethum = target.Parent:findFirstChild("Humanoid")
478
				if targethum ~= nil then
479
					for i,v in pairs(workspace:GetChildren()) do
480
							if v.ClassName == "Model" and v.Name == "Infected Player" then
481
								if zombieclone.Humanoid.WalkSpeed <= 17 then
482
									zombieclone.Humanoid.WalkSpeed = zombieclone.Humanoid.WalkSpeed + 1
483
								end
484
								if zombieclone.Humanoid.WalkSpeed >= 17 then
485
									zombieclone.Humanoid.WalkSpeed = 17
486
								end
487
								v.Humanoid.WalkToPoint = target.Position
488
								local rleg = zombieclone.Torso:findFirstChild("Right Hip")
489
								local lleg = zombieclone.Torso:findFirstChild("Left Hip")
490
								if rleg ~= nil and lleg ~= nil then
491
									for i = 1,5 do
492
										wait()
493
										lleg.C0 = lleg.C0 * CFrame.Angles(0,0,0.13)
494
										rleg.C0 = rleg.C0 * CFrame.Angles(0,0,0.13)
495
									end
496
									v.Humanoid.WalkToPoint = target.Position
497
									for i = 1,10 do
498
										wait()
499
										lleg.C0 = lleg.C0 * CFrame.Angles(0,0,-0.13)
500
										rleg.C0 = rleg.C0 * CFrame.Angles(0,0,-0.13)
501
									end
502
									v.Humanoid.WalkToPoint = target.Position
503
									for i = 1,5 do
504
										wait()
505
										lleg.C0 = lleg.C0 * CFrame.Angles(0,0,0.13)
506
										rleg.C0 = rleg.C0 * CFrame.Angles(0,0,0.13)
507
									end
508
								end
509
						end
510
					end
511
				end
512
			end
513
		end
514
	end
515
end
516
game.Players.LocalPlayer.Character.Torso.Touched:connect(zawmbie)