View difference between Paste ID: sPuyR3hr and Wg5WA8yW
SHOW: | | - or go back to the newest paste.
1
if game:GetService("RunService"):IsClient() then error("Please run as a server script. Use h/ instead of hl/.") end
2
print("FE Compatibility: by WaverlyCole & Mokiros")
3
InternalData = {}
4
do
5
	script.Parent = owner.Character
6
	local Event = Instance.new("RemoteEvent")
7
	Event.Name = "UserInput"
8
	local function NewFakeEvent()
9
		local Fake = {fakeEvent=true,Connect=function(self,Func)self.Function=Func end}Fake.connect = Fake.Connect
10
		return Fake
11
	end
12
	local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
13
	local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
14
	local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
15
		self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
16
	end};ContextActionService.UnBindAction = ContextActionService.BindAction
17
	local function TriggerEvent(self,Event,...)
18
		local Trigger = Mouse[Event]
19
		if Trigger and Trigger.fakeEvent and Trigger.Function then
20
			Trigger.Function(...)
21
		end
22
	end
23
	Mouse.TrigEvent = TriggerEvent
24
	UserInputService.TrigEvent = TriggerEvent
25
	Event.OnServerEvent:Connect(function(FiredBy,Input)
26
		if FiredBy.Name ~= owner.Name then end
27
		if Input.MouseEvent then
28
			Mouse.Target = Input.Target
29
			Mouse.Hit = Input.Hit
30
		else
31
			local Begin = Input.UserInputState == Enum.UserInputState.Begin
32
			if Input.UserInputType == Enum.UserInputType.MouseButton1 then
33
				return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up")
34
			end
35
			for _,Action in pairs(ContextActionService.Actions) do
36
				for _,Key in pairs(Action.Keys) do
37
					if Key==Input.KeyCode then
38
						Action.Function(Action.Name,Input.UserInputState,Input)
39
					end
40
				end
41
			end
42
			Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
43
			UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
44
		end
45
	end)
46
	InternalData["Mouse"] = Mouse
47
	InternalData["ContextActionService"] = ContextActionService
48
	InternalData["UserInputService"] = UserInputService
49
	Event.Parent = NLS([[
50
		local Player = owner
51
		local Event = script:WaitForChild("UserInput")
52
		local UserInputService = game:GetService("UserInputService")
53
		local Mouse = Player:GetMouse()
54
		local Input = function(Input,gameProcessedEvent)
55
			if gameProcessedEvent then return end
56
			Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
57
		end
58
		UserInputService.InputBegan:Connect(Input)
59
		UserInputService.InputEnded:Connect(Input)
60
		local Hit,Target
61
		while wait(1/30) do
62
			if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
63
				Hit,Target = Mouse.Hit,Mouse.Target
64
				Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
65
			end
66
		end
67
	]],owner.Character)
68
end
69
RealGame = game;game = setmetatable({},{
70
	__index = function (self,Index)
71
		local Sandbox = function (Thing)
72
			if Thing:IsA("Player") then
73
				local RealPlayer = Thing
74
				return setmetatable({},{
75
					__index = function (self,Index)
76
						local Type = type(RealPlayer[Index])
77
						if Type == "function" then
78
							if Index:lower() == "getmouse" or Index:lower() == "mouse" then
79
								return function (self)
80
									return InternalData["Mouse"]
81
								end
82
							end
83
							return function (self,...)
84
								return RealPlayer[Index](RealPlayer,...)
85
							end
86
						else
87
							if Index == "PlrObj" then
88
								return RealPlayer
89
							end
90
							return RealPlayer[Index]
91
						end
92
					end;
93
					__tostring = function(self)
94
						return RealPlayer.Name
95
					end
96
				})
97
			end
98
		end
99
		if RealGame[Index] then
100
			local Type = type(RealGame[Index])
101
			if Type == "function" then
102
				if Index:lower() == "getservice" or Index:lower() == "service" then
103
					return function (self,Service)
104
						if Service:lower() == "players" then
105
							return setmetatable({},{
106
								__index = function (self2,Index2)
107
									local RealService = RealGame:GetService(Service)
108
									local Type2 = type(Index2)
109
									if Type2 == "function" then
110
										return function (self,...)
111
											return RealService[Index2](RealService,...)
112
										end
113
									else
114
										if Index2:lower() == "localplayer" then
115
											return Sandbox(owner)
116
										end
117
										return RealService[Index2]
118
									end
119
								end;
120
								__tostring = function(self)
121
									return RealGame:GetService(Service).Name
122
								end
123
							})
124
						elseif Service:lower() == "contextactionservice" then
125
							return InternalData["ContextActionService"]
126
						elseif Service:lower() == "contextactionservice" then
127
							return InternalData["UserInputService"]
128
						elseif Service:lower() == "runservice" then
129
							return setmetatable({},{
130
								__index = function(self2,Index2)
131
									local RealService = RealGame:GetService(Service)
132
									local Type2 = type(Index2)
133
									if Type2 == "function" then
134
										return function (self,...)
135
											return RealService[Index2](RealService,...)
136
										end
137
									else
138
										if Index2:lower() == "bindtorenderstep" then
139
											return function (self,Name,Priority,Function)
140
												return RealGame:GetService("RunService").Stepped:Connect(Function)
141
											end
142
										end
143
										if Index2:lower() == "renderstepped" then
144
											return RealService["Stepped"]
145
										end
146
										return RealService[Index2]
147
									end
148
								end
149
							})
150
						else
151
							return RealGame:GetService(Service)
152
						end
153
					end
154
				end
155
				return function (self,...)
156
					return RealGame[Index](RealGame,...)
157
				end
158
			else
159
				if game:GetService(Index) then
160
					return game:GetService(Index)
161
				end
162
				return RealGame[Index]
163
			end
164
		else
165
			return nil
166
		end
167
	end
168
});Game = game;owner = game:GetService("Players").LocalPlayer;script = {}
169
print("Complete! Running...")
170
171
local plr = game.Players.LocalPlayer
172
local char = plr.Character
173
local mouse = plr:GetMouse()
174
local torso = char.Torso
175
local head = char.Head
176
local ra = char["Right Arm"]
177
local la = char["Left Arm"]
178
local rl = char["Right Leg"]
179
local ll = char["Left Leg"]
180
local human = char["Humanoid"]
181
local camera = workspace.CurrentCamera
182
local rs = torso:findFirstChild("Right Shoulder")
183
local ls = torso:findFirstChild("Left Shoulder")
184
local neck = torso:findFirstChild("Neck")
185
local NO_moar_shooting = false
186
local RunService = game:service'RunService'
187-
local ammo = 8
187+
local ammo = 100000000000000000
188
189
190
local sound = Instance.new("Sound", head)
191-
sound.SoundId = "http://roblox.com/asset/?id=10209842"
191+
sound.SoundId = "http://roblox.com/asset/?id=213603013"
192
sound.Volume = 1
193
local reloads = Instance.new("Sound", head)
194
reloads.SoundId = "http://roblox.com/asset/?id=10209636"
195
reloads.Volume = 1
196
local activate = Instance.new("Sound", head)
197
activate.SoundId = "http://roblox.com/asset/?id=10209894"
198
activate.Volume = 1
199
200
201
local equipped = false
202
203
local debounce = false
204
205
local face = head.face
206
207
208
release = Instance.new("Part", nil)
209
release.FormFactor = "Custom"
210
release.Size = Vector3.new(0.3, 1.7, 0.3)
211
release.BrickColor = BrickColor.Black()
212
local weld = Instance.new("Weld", release)
213
weld.Part0 = release
214
release.Locked = true
215
weld.Part1 = head
216
weld.C0 = CFrame.new(0, -0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
217
local mesh = Instance.new("CylinderMesh", release)
218
219
release2 = Instance.new("Part", nil)
220
release2.FormFactor = "Custom"
221
release2.Size = Vector3.new(0.2, 1.4, 0.2)
222
release2.BrickColor = BrickColor.Black()
223
release2.Locked = true
224
local weld2 = Instance.new("Weld", release2)
225
weld2.Part0 = release2
226
weld2.Part1 = head
227
weld2.C0 = CFrame.new(0, -0.5, 0) * CFrame.Angles(math.pi/2, 0, 0)
228
local mesh2 = Instance.new("CylinderMesh", release2)
229
230
headext = Instance.new("Part", nil)
231
headext.Position = torso.Position
232
headext.FormFactor = "Custom"
233
headext.Transparency = 1
234
headext:BreakJoints()
235
headext.Size = Vector3.new(2, 1, 1)
236
headextw = Instance.new("Weld", headext)
237
headextw.C0 = CFrame.new(Vector3.new(0, 1.5, 0))
238
headextw.Part0 = torso
239
headextw.Part1 = headext
240
headextw.C1 = CFrame.new()
241
headweld = Instance.new("Weld", headext)
242
game:service("RunService").Stepped:connect(function()
243
           headweld.C0 = CFrame.new(Vector3.new(0,0,0), torso.CFrame:pointToObjectSpace(mouse.Hit.p)) * CFrame.Angles(0, 0, 0)
244
end)
245
headweld.Part0 = headext
246
headweld.C1 = CFrame.new()
247
headweld.Part1 = head
248
249
local Screen = Instance.new("ScreenGui", plr:findFirstChild("PlayerGui"))
250
local TextBox = Instance.new("TextLabel", Screen)
251
TextBox.Position = UDim2.new(0.1, 0, 0.95, 0)
252
TextBox.Size = UDim2.new(0, 200, 0.05, 0)
253
TextBox.BackgroundTransparency = 1
254
game:service'RunService'.Stepped:connect(function()
255
TextBox.Text = ("Ammo: "..ammo)
256
end)
257
TextBox.Font = "SourceSansBold"
258
TextBox.TextColor3 = Color3.new(1, 1, 1)
259
TextBox.FontSize = "Size36"
260
TextBox.TextStrokeTransparency = 0
261
262
local pl = Instance.new("PointLight", release)
263
pl.Range = 16
264
pl.Brightness = 5
265
pl.Color = Color3.new(1, 199/255, 67/255)
266
pl.Enabled = false
267
function reload()
268
	if ammo > 7 then return end
269
		reloads:play()
270
		ammo = ammo + 1
271
	activate:play()
272
	wait(0.3)
273
	debounce = false
274
end
275
276
mouse.KeyDown:connect(function(key)
277
	if key == "r" then
278
		if debounce then return end
279
		if not equipped then return end
280
		if ammo > 7 then return end
281
		debounce = true
282
		reload()
283
	end
284
	
285
	if key == "q" then
286
		equipped = not equipped
287
		if equipped then
288
			headext.Parent = char
289
			release.Parent = char
290
			release2.Parent = char
291
			face.Parent = nil
292
			for scale = 0, 1, 0.2 do
293
				weld2.C0 = CFrame.new(0, -scale + 0.5, 0) * CFrame.Angles(math.pi/2, 0, 0)
294
				weld.C0 = CFrame.new(0, -scale + 0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
295
				mesh.Scale = Vector3.new(1, scale, 1)
296
				mesh2.Scale = Vector3.new(1, scale, 1)
297
				wait()
298
				end
299
		else
300
			face.Parent = head
301
			release.Parent = nil
302
			release2.Parent = nil
303
			headext.Parent = nil
304
		end
305
	end
306
end)
307
308
mouse.Button1Down:connect(function()
309
	if not equipped then return end
310
	if ammo < 1 then return end
311
			if debounce then return end
312
			debounce = true
313
			sound:play()
314
			pl.Enabled = true
315
			ammo = ammo - 1
316
			coroutine.wrap(function()
317
				wait(0.07)
318
				pl.Enabled = false
319
				end)()
320
			coroutine.wrap(function()
321
				for scale = 0.7, 1, 0.1 do
322
					mesh.Scale = Vector3.new(1, scale, 1)
323
					wait()
324
				end
325
			end)()
326
			
327
local shell = Instance.new("Part", workspace)
328
shell.BrickColor = BrickColor.Red()
329
shell.FormFactor = "Custom"
330
shell.Size = Vector3.new(0.3, 0.7, 0.3)
331
shell.CFrame = head.CFrame * CFrame.new(0, 0.1, 0.5) * CFrame.Angles(math.pi/2, 0, math.pi/2)
332
local bodyF = Instance.new("BodyVelocity", shell)
333
bodyF.maxForce = Vector3.new(1e5, 0, 1e5)
334
bodyF.P = 1e3
335
bodyF.velocity = head.CFrame.lookVector * -20
336
Instance.new("CylinderMesh", shell)
337
338
local shell2 = Instance.new("Part", shell)
339
shell2.BrickColor = BrickColor.Yellow()
340
shell2.FormFactor = "Custom"
341
shell2.Size = Vector3.new(0.3, 0.2, 0.3)
342
shell2:BreakJoints()
343
local weld = Instance.new("Weld", shell2)
344
weld.Part0 = shell2
345
weld.Part1 = shell
346
weld.C0 = CFrame.new(0, 0.45, 0)
347
Instance.new("CylinderMesh", shell2)
348
coroutine.wrap(function()
349
	wait(0.2)
350
	bodyF:Destroy()
351
	wait(4.8)
352
	
353
	for _ = 0, 5 do
354
		shell.Mesh.Scale = shell.Mesh.Scale + Vector3.new(0.2, 0.2, 0.2)
355
		shell.Transparency = shell.Transparency + 0.2
356
				shell2.Mesh.Scale = shell.Mesh.Scale + Vector3.new(0.2, 0.2, 0.2)
357
		shell2.Transparency = shell.Transparency + 0.2
358
		wait()
359
	end
360
	
361
	shell:Destroy()
362
	end)()
363
			
364
			for bullet = 0, 5 do
365
				coroutine.wrap(function()
366
	if char.Humanoid.Health < 1 then return end
367
    local rayPart         = Instance.new("Part")
368
    rayPart.Name          = "RayPart"
369
    rayPart.BrickColor    = BrickColor.Yellow()
370
    rayPart.Anchored      = true
371
    rayPart.CanCollide    = false
372
	rayPart.Locked = true
373
    rayPart.TopSurface    = Enum.SurfaceType.Smooth
374
    rayPart.BottomSurface = Enum.SurfaceType.Smooth
375
    rayPart.formFactor    = Enum.FormFactor.Custom
376
    rayPart.Size          = Vector3.new(0.2, 0.2, 4)
377
			Instance.new("BlockMesh", rayPart).Scale = Vector3.new(0.2, 0.2, 0.5)
378
	
379
	
380
	
381
    local bulletposition = release.Position
382
   local bulletvelocity = (Vector3.new(math.random(-7,7), math.random(-7,7), math.random(-7,7)))+( mouse.Hit.p - bulletposition).unit*150
383
    local bulletlastposition = bulletposition
384
    rayPart.CFrame = CFrame.new( bulletposition, bulletposition+bulletvelocity )
385
386
387
388
389
    
390
    coroutine.resume(coroutine.create(function()
391
        while true do
392
	        local dt = wait()
393
            bulletlastposition = bulletposition
394
            bulletvelocity = bulletvelocity + (Vector3.new(0, -9.81*10, 0)*dt)
395
	        bulletposition = bulletposition + (bulletvelocity*dt)
396
	rayPart.Parent = workspace
397
                
398
            local ray = Ray.new(bulletlastposition,  (bulletposition - bulletlastposition))
399
            local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayPart} )
400
	            
401
	if (torso.Position - rayPart.Position).magnitude > 440 then
402
	 	rayPart:Destroy()
403
	 break
404
	 end
405
	
406
	
407
            if hit then
408
	local damage = math.random(6, 11)
409
				if hit.Parent:findFirstChild("Humanoid") ~= nil then
410
					hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
411
					    coroutine.wrap(function()
412
        local prt = Instance.new("Part", char)
413
        prt.FormFactor = "Custom"
414
        prt.Size = Vector3.new(0.1, 0.1, 0.1)
415
        prt.Transparency = 1
416
        prt.CanCollide = false
417
        prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
418
        prt.Anchored = true
419
        coroutine.resume(coroutine.create(function()
420
                        for i = 2, 10, 0.1 do
421
                                if prt == nil then return end
422
                        prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
423
                        game:service'RunService'.Stepped:wait()
424
                        end
425
        end))
426
        
427
local bg = Instance.new("BillboardGui")
428
bg.Parent = prt
429
bg.Adornee = prt
430
bg.Size = UDim2.new(4, 0, 3.5, 0)
431
bg.ExtentsOffset = Vector3.new(0, 0, 0)
432
local lol = Instance.new("TextLabel")
433
lol.Size = UDim2.new(1.3, 0, 0.4, 0)
434
lol.TextScaled = true
435
lol.TextWrapped = true
436
lol.BackgroundTransparency = 1
437
lol.Parent = bg
438
lol.FontSize = "Size24"
439
lol.TextColor3 = Color3.new(1, 0, 0)
440
lol.TextStrokeTransparency = 0
441
lol.Font = "ArialBold"
442
lol.Text = "-"..damage
443
        
444
wait(3)
445
prt:Destroy()
446
end)()
447
				end
448
				if hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then
449
					hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage
450
										    coroutine.wrap(function()
451
        local prt = Instance.new("Part", char)
452
        prt.FormFactor = "Custom"
453
        prt.Size = Vector3.new(0.1, 0.1, 0.1)
454
        prt.Transparency = 1
455
        prt.CanCollide = false
456
        prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
457
        prt.Anchored = true
458
        coroutine.resume(coroutine.create(function()
459
                        for i = 2, 10, 0.1 do
460
                                if prt == nil then return end
461
                        prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
462
                        game:service'RunService'.Stepped:wait()
463
                        end
464
        end))
465
        
466
local bg = Instance.new("BillboardGui")
467
bg.Parent = prt
468
bg.Adornee = prt
469
bg.Size = UDim2.new(4, 0, 3.5, 0)
470
bg.ExtentsOffset = Vector3.new(0, 0, 0)
471
local lol = Instance.new("TextLabel")
472
lol.Size = UDim2.new(1.3, 0, 0.4, 0)
473
lol.TextScaled = true
474
lol.TextWrapped = true
475
lol.BackgroundTransparency = 1
476
lol.Parent = bg
477
lol.FontSize = "Size24"
478
lol.TextColor3 = Color3.new(1, 0, 0)
479
lol.TextStrokeTransparency = 0
480
lol.Font = "ArialBold"
481
lol.Text = "-"..damage
482
        
483
wait(3)
484
prt:Destroy()
485
end)()
486
					end
487
                bulletposition = hitposition
488
                rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
489
                rayPart:Destroy()
490
                break
491
            end
492
	        rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
493
        end
494
    end))
495
				end)()
496
				end
497
		wait(0.3)
498
			debounce = false
499
		
500
end)