View difference between Paste ID: MEfw8zhn and GhVWRJk6
SHOW: | | - or go back to the newest paste.
1
if script == nil then return end
2
3
4-
Player = game:GetService("Players"):FindFirstChild("DarkShadow6")
4+
Player = game:GetService("Players"):FindFirstChild("Newoace")
5
jetpackGyro = nil
6
jetpackGyroAdd = CFrame.fromEulerAnglesXYZ(-3.14 / 2, 0, 0)
7
jetpackVelocity = nil
8
jetpackFloating = false
9
jetpackSpeed2 = 75
10
jetpackSpeed = jetpackSpeed2
11
12
13
function makeParts()
14
	local jetpack = Instance.new("Model")
15
	jetpack.Name = "Jetpack"
16
	jetpack.Parent = Player.Character
17
	local p = Instance.new("Part")
18
	p.Name = "Backpack"
19
	p.FormFactor = "Custom"
20
	p.size = Vector3.new(2, 2, 1)
21
	p.BrickColor = BrickColor.new("Institutional white")
22
	p.Locked = true
23
	p.TopSurface = 0
24
	p.BottomSurface = 0
25
	p.Parent = jetpack
26
	local m = Instance.new("SpecialMesh")
27
	m.MeshType = "Brick"
28
	m.Scale = Vector3.new(1, 1, 1)
29
	m.Parent = p
30
	local w = Instance.new("Weld")
31
	w.Part0 = p
32
	w.Part1 = Player.Character:FindFirstChild("Torso")
33
	w.C0 = CFrame.new(0, 0, -1)
34
	w.C1 = CFrame.new()
35
	w.Parent = p
36
	local p = Instance.new("Part")
37
	p.Name = "Left Wing Open 1"
38
	p.Transparency = 1
39
	p.FormFactor = "Custom"
40
	p.size = Vector3.new(3, 2, 1)
41
	p.BrickColor = BrickColor.new("Really black")
42
	p.Locked = true
43
	p.TopSurface = 0
44
	p.BottomSurface = 0
45
	p.Parent = jetpack
46
	local m = Instance.new("SpecialMesh")
47
	m.MeshType = "Brick"
48
	m.Scale = Vector3.new(1, 0.75, 0.25)
49
	m.Parent = p
50
	local w = Instance.new("Weld")
51
	w.Part0 = p
52
	w.Part1 = Player.Character:FindFirstChild("Torso")
53
	w.C0 = CFrame.new(2.5, 0, -1)
54
	w.C1 = CFrame.new()
55
	w.Parent = p
56
	local p = Instance.new("Part")
57
	p.Name = "Left Wing Open 2"
58
	p.Transparency = 1
59
	p.FormFactor = "Custom"
60
	p.size = Vector3.new(1, 2, 1)
61
	p.BrickColor = BrickColor.new("Really black")
62
	p.Locked = true
63
	p.TopSurface = 0
64
	p.BottomSurface = 0
65
	p.Parent = jetpack
66
	local m = Instance.new("SpecialMesh")
67
	m.MeshType = "Head"
68
	m.Scale = Vector3.new(1, 1, 1)
69
	m.Parent = p
70
	local w = Instance.new("Weld")
71
	w.Part0 = p
72
	w.Part1 = Player.Character:FindFirstChild("Torso")
73
	w.C0 = CFrame.new(4.5, 0, -1)
74
	w.C1 = CFrame.new()
75
	w.Parent = p
76
	local p = Instance.new("Part")
77
	p.Name = "Left Wing Open 3"
78
	p.Transparency = 1
79
	p.FormFactor = "Custom"
80
	p.size = Vector3.new(1, 2, 1)
81
	p.BrickColor = BrickColor.new("Really black")
82
	p.Locked = true
83
	p.TopSurface = 0
84
	p.BottomSurface = 0
85
	p.Parent = jetpack
86
	local m = Instance.new("SpecialMesh")
87
	m.MeshType = "Head"
88
	m.Scale = Vector3.new(0.5, 1.5, 0.5)
89
	m.MeshId = "http://www.roblox.com/Asset/?id=1033714"
90
	m.Parent = p
91
	local w = Instance.new("Weld")
92
	w.Part0 = p
93
	w.Part1 = Player.Character:FindFirstChild("Torso")
94
	w.C0 = CFrame.new(4.5, -1.325, -1)
95
	w.C1 = CFrame.new()
96
	w.Parent = p
97
	local p = Instance.new("Part")
98
	p.Name = "Left Wing Closed 1"
99
	p.FormFactor = "Custom"
100
	p.size = Vector3.new(1, 2, 1)
101
	p.BrickColor = BrickColor.new("Really black")
102
	p.Locked = true
103
	p.TopSurface = 0
104
	p.BottomSurface = 0
105
	p.Parent = jetpack
106
	local m = Instance.new("SpecialMesh")
107
	m.MeshType = "Head"
108
	m.Scale = Vector3.new(1, 1, 1)
109
	m.Parent = p
110
	local w = Instance.new("Weld")
111
	w.Part0 = p
112
	w.Part1 = Player.Character:FindFirstChild("Torso")
113
	w.C0 = CFrame.new(1.25, 0, -1)
114
	w.C1 = CFrame.new()
115
	w.Parent = p
116
	local p = Instance.new("Part")
117
	p.Name = "Left Wing Closed 2"
118
	p.FormFactor = "Custom"
119
	p.size = Vector3.new(1, 2, 1)
120
	p.BrickColor = BrickColor.new("Really black")
121
	p.Locked = true
122
	p.TopSurface = 0
123
	p.BottomSurface = 0
124
	p.Parent = jetpack
125
	local m = Instance.new("SpecialMesh")
126
	m.MeshType = "Head"
127
	m.Scale = Vector3.new(0.5, 1.5, 0.5)
128
	m.MeshId = "http://www.roblox.com/Asset/?id=1033714"
129
	m.Parent = p
130
	local w = Instance.new("Weld")
131
	w.Part0 = p
132
	w.Part1 = Player.Character:FindFirstChild("Torso")
133
	w.C0 = CFrame.new(1.25, -1.325, -1)
134
	w.C1 = CFrame.new()
135
	w.Parent = p
136
	local p = Instance.new("Part")
137
	p.Name = "Right Wing Open 1"
138
	p.Transparency = 1
139
	p.FormFactor = "Custom"
140
	p.size = Vector3.new(3, 2, 1)
141
	p.BrickColor = BrickColor.new("Really black")
142
	p.Locked = true
143
	p.TopSurface = 0
144
	p.BottomSurface = 0
145
	p.Parent = jetpack
146
	local m = Instance.new("SpecialMesh")
147
	m.MeshType = "Brick"
148
	m.Scale = Vector3.new(1, 0.75, 0.25)
149
	m.Parent = p
150
	local w = Instance.new("Weld")
151
	w.Part0 = p
152
	w.Part1 = Player.Character:FindFirstChild("Torso")
153
	w.C0 = CFrame.new(-2.5, 0, -1)
154
	w.C1 = CFrame.new()
155
	w.Parent = p
156
	local p = Instance.new("Part")
157
	p.Name = "Right Wing Open 2"
158
	p.Transparency = 1
159
	p.FormFactor = "Custom"
160
	p.size = Vector3.new(1, 2, 1)
161
	p.BrickColor = BrickColor.new("Really black")
162
	p.Locked = true
163
	p.TopSurface = 0
164
	p.BottomSurface = 0
165
	p.Parent = jetpack
166
	local m = Instance.new("SpecialMesh")
167
	m.MeshType = "Head"
168
	m.Scale = Vector3.new(1, 1, 1)
169
	m.Parent = p
170
	local w = Instance.new("Weld")
171
	w.Part0 = p
172
	w.Part1 = Player.Character:FindFirstChild("Torso")
173
	w.C0 = CFrame.new(-4.5, 0, -1)
174
	w.C1 = CFrame.new()
175
	w.Parent = p
176
	local p = Instance.new("Part")
177
	p.Name = "Right Wing Open 3"
178
	p.Transparency = 1
179
	p.FormFactor = "Custom"
180
	p.size = Vector3.new(1, 2, 1)
181
	p.BrickColor = BrickColor.new("Really black")
182
	p.Locked = true
183
	p.TopSurface = 0
184
	p.BottomSurface = 0
185
	p.Parent = jetpack
186
	local m = Instance.new("SpecialMesh")
187
	m.MeshType = "Head"
188
	m.Scale = Vector3.new(0.5, 1.5, 0.5)
189
	m.MeshId = "http://www.roblox.com/Asset/?id=1033714"
190
	m.Parent = p
191
	local w = Instance.new("Weld")
192
	w.Part0 = p
193
	w.Part1 = Player.Character:FindFirstChild("Torso")
194
	w.C0 = CFrame.new(-4.5, -1.325, -1)
195
	w.C1 = CFrame.new()
196
	w.Parent = p
197
	local p = Instance.new("Part")
198
	p.Name = "Right Wing Closed 1"
199
	p.FormFactor = "Custom"
200
	p.size = Vector3.new(1, 2, 1)
201
	p.BrickColor = BrickColor.new("Really black")
202
	p.Locked = true
203
	p.TopSurface = 0
204
	p.BottomSurface = 0
205
	p.Parent = jetpack
206
	local m = Instance.new("SpecialMesh")
207
	m.MeshType = "Head"
208
	m.Scale = Vector3.new(1, 1, 1)
209
	m.Parent = p
210
	local w = Instance.new("Weld")
211
	w.Part0 = p
212
	w.Part1 = Player.Character:FindFirstChild("Torso")
213
	w.C0 = CFrame.new(-1.25, 0, -1)
214
	w.C1 = CFrame.new()
215
	w.Parent = p
216
	local p = Instance.new("Part")
217
	p.Name = "Right Wing Closed 2"
218
	p.FormFactor = "Custom"
219
	p.size = Vector3.new(1, 2, 1)
220
	p.BrickColor = BrickColor.new("Really black")
221
	p.Locked = true
222
	p.TopSurface = 0
223
	p.BottomSurface = 0
224
	p.Parent = jetpack
225
	local m = Instance.new("SpecialMesh")
226
	m.MeshType = "Head"
227
	m.Scale = Vector3.new(-0.5, 1.5, 0.5)
228
	m.MeshId = "http://www.roblox.com/Asset/?id=1033714"
229
	m.Parent = p
230
	local w = Instance.new("Weld")
231
	w.Part0 = p
232
	w.Part1 = Player.Character:FindFirstChild("Torso")
233
	w.C0 = CFrame.new(-1.25, -1.325, -1)
234
	w.C1 = CFrame.new()
235
	w.Parent = p
236
end
237
238
239
function removeParts()
240
	if Player.Character:FindFirstChild("Jetpack") ~= nil then
241
		Player.Character.Jetpack:Remove()
242
	end
243
end
244
245
246
function Weld(x, y)
247
	weld = Instance.new("Weld")
248
	weld.Part0 = x
249
	weld.Part1 = y
250
	CJ = CFrame.new(x.Position)
251
	C0 = x.CFrame:inverse() * CJ
252
	C1 = y.CFrame:inverse() * CJ
253
	weld.C0 = C0
254
	weld.C1 = C1
255
	weld.Parent = x
256
end
257
258
259
function Wings(format)
260
	if Player.Character:FindFirstChild("Jetpack") == nil then return false end
261
	if format == 0 then
262
		if jetpackFloating == false then
263
			if Player.Character:FindFirstChild("Torso") ~= nil then
264
				if Player.Character.Torso:FindFirstChild("Neck") ~= nil then
265
					Player.Character.Torso.Neck.C0 = CFrame.new(0, 1.5, 0.25)
266
					Player.Character.Torso.Neck.C1 = CFrame.fromEulerAnglesXYZ(-3.14 / 2.5, 0, 0)
267
				end
268
			end
269
		end
270
		Children = Player.Character.Jetpack:GetChildren()
271
		for i = 1, #Children do
272
			if string.match(Children[i].Name, "Wing Open") then
273
				Children[i].Transparency = 0
274
				Children[i].CanCollide = true
275
			end
276
			if string.match(Children[i].Name, "Wing Closed") then
277
				Children[i].Transparency = 1
278
				Children[i].CanCollide = false
279
			end
280
		end
281
		local s = Instance.new("Smoke")
282
		s.Name = "Smoke"
283
		s.RiseVelocity = -5
284
		s.Size = 1
285
		s.Color = Color3.new(0.5, 0.5, 0.5)
286
		s.Enabled = true
287
		local f = Instance.new("Fire")
288
		f.Name = "Fire"
289
		f.Heat = -25
290
		f.Size = 3
291
		f.Enabled = true
292
		if Player.Character.Jetpack:FindFirstChild("Left Wing Open 2") ~= nil then
293
			if Player.Character.Jetpack["Left Wing Open 2"]:FindFirstChild("Smoke") == nil then
294
				s:Clone().Parent =  Player.Character.Jetpack["Left Wing Open 2"]
295
				f:Clone().Parent =  Player.Character.Jetpack["Left Wing Open 2"]
296
			end
297
		end
298
		if Player.Character.Jetpack:FindFirstChild("Right Wing Open 2") ~= nil then
299
			if Player.Character.Jetpack["Right Wing Open 2"]:FindFirstChild("Smoke") == nil then
300
				s:Clone().Parent =  Player.Character.Jetpack["Right Wing Open 2"]
301
				f:Clone().Parent =  Player.Character.Jetpack["Right Wing Open 2"]
302
			end
303
		end
304
	elseif format == 1 then
305
		if Player.Character:FindFirstChild("Torso") ~= nil then
306
			if Player.Character.Torso:FindFirstChild("Neck") ~= nil then
307
				Player.Character.Torso.Neck.C0 = CFrame.new(0, 1.5, 0)
308
				Player.Character.Torso.Neck.C1 = CFrame.new(0, 0, 0)
309
			end
310
		end
311
		Children = Player.Character.Jetpack:GetChildren()
312
		for i = 1, #Children do
313
			if string.match(Children[i].Name, "Wing Open") then
314
				Children[i].Transparency = 1
315
				Children[i].CanCollide = false
316
			end
317
			if string.match(Children[i].Name, "Wing Closed") then
318
				Children[i].Transparency = 0
319
				Children[i].CanCollide = true
320
			end
321
		end
322
		if Player.Character.Jetpack:FindFirstChild("Left Wing Open 2") ~= nil then
323
			if Player.Character.Jetpack["Left Wing Open 2"]:FindFirstChild("Smoke") ~= nil then
324
				Player.Character.Jetpack["Left Wing Open 2"].Smoke:Remove()
325
			end
326
		end
327
		if Player.Character.Jetpack:FindFirstChild("Right Wing Open 2") ~= nil then
328
			if Player.Character.Jetpack["Right Wing Open 2"]:FindFirstChild("Smoke") ~= nil then
329
				Player.Character.Jetpack["Right Wing Open 2"].Smoke:Remove()
330
			end
331
		end
332
		if Player.Character.Jetpack:FindFirstChild("Left Wing Open 2") ~= nil then
333
			if Player.Character.Jetpack["Left Wing Open 2"]:FindFirstChild("Fire") ~= nil then
334
				Player.Character.Jetpack["Left Wing Open 2"].Fire:Remove()
335
			end
336
		end
337
		if Player.Character.Jetpack:FindFirstChild("Right Wing Open 2") ~= nil then
338
			if Player.Character.Jetpack["Right Wing Open 2"]:FindFirstChild("Fire") ~= nil then
339
				Player.Character.Jetpack["Right Wing Open 2"].Fire:Remove()
340
			end
341
		end
342
	end	
343
end
344
345
346
function onButton1Down(mouse)
347
	if Player.Character:FindFirstChild("Jetpack") == nil then return end --or Button1Down == truethen return end
348
	mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
349
	Button1Down = true
350
	if Player.Character:FindFirstChild("Humanoid") ~= nil then
351
		Player.Character.Humanoid.PlatformStand = true
352
	end
353
	Wings(0)
354
	while Button1Down == true do
355
		if Player.Character == nil then return end
356
		if Player.Character:FindFirstChild("Torso") == nil then return end
357
		if Player.Character:FindFirstChild("Humanoid") == nil then return end
358
		if Player.Character:FindFirstChild("Jetpack") == nil then return end
359
		if jetpackGyro == nil then
360
			jetpackGyro = Instance.new("BodyGyro")
361
			jetpackGyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
362
			jetpackGyro.Parent = Player.Character.Torso
363
		end
364
		if jetpackVelocity == nil then
365
			jetpackVelocity = Instance.new("BodyVelocity")
366
			jetpackVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
367
			jetpackVelocity.P = 100
368
			jetpackVelocity.Parent = Player.Character.Torso
369
		end
370
		jetpackGyro.cframe = CFrame.new(Player.Character.Torso.Position, mouse.Hit.p) * jetpackGyroAdd
371
		jetpackVelocity.velocity = (mouse.Hit.p - Player.Character.Torso.Position).unit * jetpackSpeed
372
		wait(0.01)
373
	end
374
end
375
376
377
function onButton1Up(mouse)
378
	if jetpackGyro ~= nil then
379
		jetpackGyro:Remove()
380
		jetpackGyro = nil
381
	end
382
	if jetpackVelocity ~= nil then
383
		jetpackVelocity:Remove()
384
		jetpackVelocity = nil
385
	end
386
	if Player.Character:FindFirstChild("Humanoid") ~= nil then
387
		Player.Character.Humanoid.PlatformStand = false
388
	end
389
	Wings(1)
390
	Button1Down = false
391
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
392
end
393
394
395
function onKeyDown(key, mouse)
396
	key = key:lower()
397
	if key == "q" then
398
		if jetpackFloating == true then
399
			jetpackFloating = false
400
			jetpackGyroAdd = CFrame.fromEulerAnglesXYZ(-3.14 / 2, 0, 0)
401
			jetpackSpeed = jetpackSpeed2
402
			if Button1Down == true then
403
				if Player.Character:FindFirstChild("Torso") ~= nil then
404
					if Player.Character.Torso:FindFirstChild("Neck") ~= nil then
405
						Player.Character.Torso.Neck.C0 = CFrame.new(0, 1.5, 0.25)
406
						Player.Character.Torso.Neck.C1 = CFrame.fromEulerAnglesXYZ(-3.14 / 2.5, 0, 0)
407
					end
408
				end
409
			end
410
		elseif jetpackFloating == false then
411
			jetpackFloating = true
412
			jetpackGyroAdd = CFrame.fromEulerAnglesXYZ(0, 0, 0)
413
			jetpackSpeed2 = jetpackSpeed
414
			jetpackSpeed = 0
415
			if Button1Down == true then
416
				if Player.Character:FindFirstChild("Torso") ~= nil then
417
					if Player.Character.Torso:FindFirstChild("Neck") ~= nil then
418
						Player.Character.Torso.Neck.C0 = CFrame.new(0, 1.5, 0)
419
						Player.Character.Torso.Neck.C1 = CFrame.new(0, 0, 0)
420
					end
421
				end
422
			end
423
		end
424
	end
425
	if jetpackFloating == false then
426
		if key == "z" then
427
			if jetpackSpeed >= 25 then
428
				jetpackSpeed = jetpackSpeed - 25
429
			else
430
				jetpackSpeed = 25
431
			end
432
		end
433
		if key == "x" then
434
			if jetpackSpeed <= 1000 then
435
				jetpackSpeed = jetpackSpeed + 25
436
			else
437
				jetpackSpeed = 1000
438
			end
439
		end
440
	end
441
end
442
443
444
function onKeyUp(key, mouse)
445
	key = key:lower()
446
end
447
448
function onSelected(mouse)
449
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
450
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
451
	mouse.Button1Up:connect(function() onButton1Up(mouse) end)
452
	mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
453
	mouse.KeyUp:connect(function(key) onKeyUp(key, mouse) end)
454
	makeParts()
455
end
456
457
458
function onDeselected(mouse)
459
	Button1Down = false
460
	jetpackFloating = false
461
	jetpackGyroAdd = CFrame.fromEulerAnglesXYZ(-3.14 / 2, 0, 0)
462
	jetpackSpeed = jetpackSpeed2
463
	if jetpackGyro ~= nil then
464
		jetpackGyro:Remove()
465
		jetpackGyro = nil
466
	end
467
	if jetpackVelocity ~= nil then
468
		jetpackVelocity:Remove()
469
		jetpackVelocity = nil
470
	end
471
	if Player.Character:FindFirstChild("Humanoid") ~= nil then
472
		Player.Character.Humanoid.PlatformStand = false
473
	end
474
	removeParts()
475
end
476
477
478
if script.Parent.ClassName ~= "HopperBin" then
479
	if Player == nil then print("Error: Player not found!") return end
480
	Tool = Instance.new("HopperBin")
481
	Tool.Name = "Jetpack"
482
	Tool.Parent = Player.Backpack
483
	script.Name = "Main"
484
	script.Parent = Tool
485
elseif script.Parent.ClassName == "HopperBin" then
486
	Player = script.Parent.Parent.Parent
487
	script.Parent.Selected:connect(onSelected)
488
	script.Parent.Deselected:connect(onDeselected)
489
end