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