View difference between Paste ID: zwB2vsZJ 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
if graphic then
294
	graphicid = graphic.Graphic
295
end
296
caninfect = true
297
invisible = false
298
function targettool()
299
	local torso = mouse.Target.Parent:findFirstChild("Torso")
300
	local humanoid = mouse.Target.Parent:findFirstChild("Humanoid")
301
	if torso and humanoid then
302
		target = torso
303
		print("You are now targetting "..torso.Parent.Name)
304
	end
305
end
306
mouse.Button1Down:connect(targettool)
307
function inv(key)
308
	if key == "q" then
309
		invisible = not invisible
310
		if invisible then
311
			game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 40
312
			for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
313
				if v.ClassName == "Part" then
314
					if v.Name == "HumanoidRootPart" then
315
						
316
					else
317
						v.Transparency = 1
318
					end
319
				end
320
				game.Players.LocalPlayer.Character.Head.face.Transparency = 1
321
				for q,w in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
322
					if w.ClassName == "Shirt Graphic" then
323
						w.Graphic = "rbxassetid://0"
324
					end
325
				end
326
				for e,r in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
327
					if r.ClassName == "Accessory" or r.ClassName == "Hat" then
328
						r.Handle.Transparency = 1
329
					end
330
				end
331
			end
332
		end
333
		if not invisible then
334
			game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
335
			for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
336
				if v.ClassName == "Part" then
337
					if v.Name == "HumanoidRootPart" then
338
						
339
					else
340
						v.Transparency = 0
341
					end
342
				end
343
				game.Players.LocalPlayer.Character.Head.face.Transparency = 0
344
				for q,w in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
345
					if w.ClassName == "Shirt Graphic" then
346
						w.Graphic = graphicid
347
					end
348
				end
349
				for e,r in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
350
					if r.ClassName == "Accessory" or r.ClassName == "Hat" then
351
						r.Handle.Transparency = 0
352
					end
353
				end
354
			end
355
		end
356
	end
357
end
358
mouse.KeyDown:connect(inv)
359
function zawmbie(part)
360
	if part.Parent then
361
		torso = part.Parent:findFirstChild("Torso")
362
		humanoid = part.Parent:findFirstChild("Humanoid")
363
	end
364
	if caninfect and torso and humanoid ~= nil and part.Parent ~= nil then
365
		if torso.Parent.Name == "Infected Player" then
366
			--nono
367
		else
368
			torso.Parent.Archivable = true
369
			local zombieclone = torso.Parent:Clone()
370
			zombieclone.Name = "Infected Player"
371
			torso.Anchored = true
372
			humanoid.Health = 0
373
			for i,v in pairs(torso.Parent:GetChildren()) do
374
				if v.ClassName == "Part" then
375
					v.CFrame = v.CFrame * CFrame.new(0,50,0)
376
					v.Anchored = true
377
					v.Transparency = 1
378
				end
379
				if v.ClassName == "Hat" or v.ClassName == "Accessory" then
380
					v:destroy()
381
				end
382
			end
383
			local infectionsound = Instance.new("Sound", torso.Parent.Head)
384
			infectionsound.SoundId = "rbxassetid://130976109"
385
			infectionsound.Volume = 10
386
			infectionsound:Play()
387
			zombieclone.Parent = workspace
388
			local function die()
389
				wait(5)
390
				zombieclone:destroy()
391
			end
392
			zombieclone.Humanoid.Died:connect(die)
393
			local face = zombieclone.Head:findFirstChild("face")
394
			if face ~= nil then
395
				face.Texture = "rbxassetid://19986263"
396
			end
397
			zombieclone.Torso.CFrame = zombieclone.Torso.CFrame * CFrame.new(4,0,4)
398
			zombieclone.Humanoid.MaxHealth = humanoid.MaxHealth * 2
399
			zombieclone.Humanoid.Health = zombieclone.Humanoid.MaxHealth
400
			zombieclone.Humanoid.WalkSpeed = 1
401
			local rarmfornow = zombieclone.Torso:findFirstChild("Right Shoulder")
402
			local larmfornow = zombieclone.Torso:findFirstChild("Left Shoulder")
403
			if rarmfornow ~= nil then
404
				for i = 1,2 do
405
					wait()
406
					rarmfornow.C0 = rarmfornow.C0 * CFrame.Angles(0,0,0.09)
407
				end
408
				for i = 1,3 do
409
					wait()
410
					rarmfornow.C0 = rarmfornow.C0 * CFrame.Angles(0,0,0.11)
411
				end
412
				for i = 1,6 do
413
					wait()
414
					rarmfornow.C0 = rarmfornow.C0 * CFrame.Angles(0,0,0.12)
415
				end
416
				for i = 1,3 do
417
					wait()
418
					rarmfornow.C0 = rarmfornow.C0 * CFrame.Angles(0,0,0.11)
419
				end
420
				for i = 1,2 do
421
					wait()
422
					rarmfornow.C0 = rarmfornow.C0 * CFrame.Angles(0,0,0.09)
423
				end
424
			end
425
			if larmfornow ~= nil then
426
				for i = 1,2 do
427
					wait()
428
					larmfornow.C0 = larmfornow.C0 * CFrame.Angles(0,0,-0.09)
429
				end
430
				for i = 1,3 do
431
					wait()
432
					larmfornow.C0 = larmfornow.C0 * CFrame.Angles(0,0,-0.11)
433
				end
434
				for i = 1,6 do
435
					wait()
436
					larmfornow.C0 = larmfornow.C0 * CFrame.Angles(0,0,-0.12)
437
				end
438
				for i = 1,3 do
439
					wait()
440
					larmfornow.C0 = larmfornow.C0 * CFrame.Angles(0,0,-0.11)
441
				end
442
				for i = 1,2 do
443
					wait()
444
					larmfornow.C0 = larmfornow.C0 * CFrame.Angles(0,0,-0.09)
445
				end
446
			end
447
			wait(3)
448
			zombieclone.Torso.Touched:connect(zawmbie)
449
			canchange = true
450
			function change()
451
				if canchange then
452
					canchange = false
453
					ply = game.Players:GetPlayers()[math.random(game.Players.NumPlayers)]
454
					local plytorso = ply.Character:findFirstChild("Torso")
455
					local plyhumanoid = ply.Character:findFirstChild("Humanoid")
456
					if ply.Name == game.Players.LocalPlayer.Name or not plyhumanoid or not plytorso or plytorso.Transparency == 1 then
457
						change()
458
					else
459
						target = ply.Character.Torso
460
						print(target.Parent.Name)
461
					end
462
					wait(5)
463
					canchange = true
464
				end
465
			end
466
			zombieclone.Torso.Touched:connect(change)
467
			while true do
468
				wait()
469
				for i,v in pairs(game.Players:GetChildren()) do
470
					local char = v:findFirstChild("Character")
471
					if char ~= nil then
472
						local ws = v.Character:findFirstChild("Humanoid")
473
						if ws ~= nil then
474
							if ws.WalkSpeed >= 41 then
475
								ws.WalkSpeed = 16
476
							end
477
						end
478
					end
479
				end
480
				local targethum = target.Parent:findFirstChild("Humanoid")
481
				if targethum ~= nil then
482
					for i,v in pairs(workspace:GetChildren()) do
483
							if v.ClassName == "Model" and v.Name == "Infected Player" then
484
								if zombieclone.Humanoid.WalkSpeed <= 17 then
485
									zombieclone.Humanoid.WalkSpeed = zombieclone.Humanoid.WalkSpeed + 1
486
								end
487
								if zombieclone.Humanoid.WalkSpeed >= 17 then
488
									zombieclone.Humanoid.WalkSpeed = 17
489
								end
490
								v.Humanoid.WalkToPoint = target.Position
491
								local rleg = zombieclone.Torso:findFirstChild("Right Hip")
492
								local lleg = zombieclone.Torso:findFirstChild("Left Hip")
493
								if rleg ~= nil and lleg ~= nil then
494
									for i = 1,5 do
495
										wait()
496
										lleg.C0 = lleg.C0 * CFrame.Angles(0,0,0.13)
497
										rleg.C0 = rleg.C0 * CFrame.Angles(0,0,0.13)
498
									end
499
									v.Humanoid.WalkToPoint = target.Position
500
									for i = 1,10 do
501
										wait()
502
										lleg.C0 = lleg.C0 * CFrame.Angles(0,0,-0.13)
503
										rleg.C0 = rleg.C0 * CFrame.Angles(0,0,-0.13)
504
									end
505
									v.Humanoid.WalkToPoint = target.Position
506
									for i = 1,5 do
507
										wait()
508
										lleg.C0 = lleg.C0 * CFrame.Angles(0,0,0.13)
509
										rleg.C0 = rleg.C0 * CFrame.Angles(0,0,0.13)
510
									end
511
								end
512
						end
513
					end
514
				end
515
			end
516
		end
517
	end
518
end
519
game.Players.LocalPlayer.Character.Torso.Touched:connect(zawmbie)