Advertisement
KHSora455

Jetpack V2

Feb 16th, 2015
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.29 KB | None | 0 0
  1. if (script.Parent.className ~= "HopperBin") then
  2. local h = Instance.new("HopperBin")
  3. h.Name = "Jetpack V2"
  4. h.Parent = game.Players["Sora295"].Backpack
  5. script.Parent = h
  6. script.Name = "Function"
  7. end
  8. Bin = script.Parent
  9. Person = game.Players.LocalPlayer
  10. PersonT = Person.Character.Torso
  11. Hold = false
  12. Lazer = false
  13. Grabbed = nil
  14. Debounce = false
  15. FDebounce = false
  16. Flight = false
  17. NormalHand = 1 --Change to your preffered hand 1 being "Right" and 2 begin "Left"
  18. NormalFoot = 4 --Change to your preffered foot 3 being "Right" and 4 begin "Left"
  19. Joints = {PersonT:findFirstChild("Right Shoulder"), PersonT:findFirstChild("Left Shoulder"), PersonT:findFirstChild("Right Hip"), PersonT:findFirstChild("Left Hip")}
  20. Limbs = {Person.Character:findFirstChild("Right Arm"), Person.Character:findFirstChild("Left Arm"), Person.Character:findFirstChild("Right Leg"), Person.Character:findFirstChild("Left Leg")}
  21. if (Person.Character:findFirstChild("Suit") ~= nil) then
  22. Person.Character.Suit:remove()
  23. end
  24. Suit = Instance.new("Model")
  25. Suit.Parent = Person.Character
  26. Suit.Name = "Suit"
  27.  
  28. ---Watch
  29. Band = Instance.new("Part")
  30. Band.Parent = Suit
  31. Band.Name = "Band"
  32. Band.CanCollide = false
  33. Band.formFactor = "Symmetric"
  34. Band.Size = Vector3.new(1, 1, 1)
  35. Band.BrickColor = BrickColor.new("Really black")
  36. Band.TopSurface = 0
  37. Band.BottomSurface = 0
  38. BandM = Instance.new("SpecialMesh")
  39. BandM.MeshType = "Brick"
  40. BandM.Parent = Band
  41. BandM.Scale = Vector3.new(1.03, 0.2, 1.03)
  42. Band:BreakJoints()
  43. Weld = Instance.new("Weld")
  44. Weld.Parent = Band
  45. Weld.Part0 = Limbs[NormalHand]
  46. Weld.Part1 = Band
  47. Weld.C0 = CFrame.new(0, -0.6, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  48. Watch1 = Instance.new("Part")
  49. Watch1.Parent = Suit
  50. Watch1.Name = "Watch1"
  51. Watch1.CanCollide = false
  52. Watch1.formFactor = "Symmetric"
  53. Watch1.Size = Vector3.new(1, 1, 1)
  54. Watch1.BrickColor = BrickColor.new("Really black")
  55. Watch1.TopSurface = 0
  56. Watch1.BottomSurface = 0
  57. Watch1M = Instance.new("CylinderMesh")
  58. Watch1M.Parent = Watch1
  59. Watch1M.Scale = Vector3.new(0.3, 0.2, 0.3)
  60. Watch1:BreakJoints()
  61. Weld = Instance.new("Weld")
  62. Weld.Parent = Watch1
  63. Weld.Part0 = Band
  64. Weld.Part1 = Watch1
  65. Weld.C0 = CFrame.new(0, 0, -0.41) * CFrame.fromEulerAnglesXYZ(1.57, 0, 0)
  66. Watch2 = Instance.new("Part")
  67. Watch2.Parent = Suit
  68. Watch2.Name = "Watch2"
  69. Watch2.CanCollide = false
  70. Watch2.formFactor = "Symmetric"
  71. Watch2.Size = Vector3.new(1, 1, 1)
  72. Watch2.BrickColor = BrickColor.new("Really red")
  73. Watch2.TopSurface = 0
  74. Watch2.BottomSurface = 0
  75. Watch2M = Instance.new("CylinderMesh")
  76. Watch2M.Parent = Watch2
  77. Watch2M.Scale = Vector3.new(0.25, 0.2, 0.25)
  78. Watch2:BreakJoints()
  79. Weld = Instance.new("Weld")
  80. Weld.Parent = Watch2
  81. Weld.Part0 = Band
  82. Weld.Part1 = Watch2
  83. Weld.C0 = CFrame.new(0, 0, -0.42) * CFrame.fromEulerAnglesXYZ(1.57, 0, 0)
  84. ---Real Function
  85. function SetAngle(Joint, Angle)
  86. if (Joint == 1) or (Joint == 3) then
  87. Joints[Joint].DesiredAngle = Angle
  88. end
  89. if (Joint == 2) or (Joint == 4) then
  90. Joints[Joint].DesiredAngle = -Angle
  91. end
  92. end
  93. function DisableLimb(Limb)
  94. Joints[Limb]:remove()
  95.  
  96. Joint = Instance.new("Motor")
  97. Joint.Parent = Person.Character.Torso
  98. Joint.Part0 = Person.Character.Torso
  99. Joint.Part1 = Limbs[Limb]
  100. Joint.MaxVelocity = 0.1
  101. if (Limb == 1) then
  102. C0 = CFrame.new(PersonT.Size.x/2 + Limbs[Limb].Size.x/2, Limbs[Limb].Size.y/4, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14/2, 0)
  103. Joint.C1 = CFrame.new(0, Limbs[Limb].Size.y/4, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14/2, 0)
  104. Joint.Name = "Right Joint Top"
  105. elseif (Limb == 2) then
  106. C0 = CFrame.new(-PersonT.Size.x/2 - Limbs[Limb].Size.x/2, Limbs[Limb].Size.y/4, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14/2, 0)
  107. Joint.C1 = CFrame.new(0, Limbs[Limb].Size.y/4, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14/2, 0)
  108. Joint.Name = "Left Joint Top"
  109. elseif (Limb == 3) then
  110. C0 = CFrame.new(Limbs[Limb].Size.x/2, -(Limbs[Limb].Size.y/4) * 3, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14/2, 0)
  111. Joint.C1 = CFrame.new(0, Limbs[Limb].Size.y/4, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14/2, 0)
  112. Joint.Name = "Right Joint Bottom"
  113. elseif(Limb == 4) then
  114. C0 = CFrame.new(-Limbs[Limb].Size.x/2, -(Limbs[Limb].Size.y/4) * 3, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14/2, 0)
  115. Joint.C1 = CFrame.new(0, Limbs[Limb].Size.y/4, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14/2, 0)
  116. Joint.Name = "Left Joint Bottom"
  117. end
  118. Joint.C0 = C0
  119. Joints[Limb] = Joint
  120. end
  121. function EnableLimb(Limb)
  122. if (Limb == 1) then
  123. Joints[Limb].Name = "Right Shoulder"
  124. elseif (Limb == 2) then
  125. Joints[Limb].Name = "Left Shoulder"
  126. elseif (Limb == 3) then
  127. Joints[Limb].Name = "Right Hip"
  128. elseif(Limb == 4) then
  129. Joints[Limb].Name = "Left Hip"
  130. end
  131. Anim = Person.Character.Animate:clone()
  132. Person.Character.Animate:remove()
  133. Anim.Parent = Person.Character
  134. end
  135. function Grab(Part)
  136. if (Grabbed == nil) then
  137. if (Part.Parent ~= nil) then
  138. Human = Part.Parent:findFirstChild("Humanoid")
  139. if (Human ~= nil) then
  140. Player = game.Players:GetPlayerFromCharacter(Human.Parent)
  141. if (Player ~= nil) then
  142. if (Player ~= Person) then
  143. Human.Sit = true
  144. Weld = Instance.new("Weld")
  145. Weld.Name = "Grip"
  146. Weld.Parent = Person.Character.Torso
  147. Weld.Part0 = Person.Character.Torso
  148. Weld.Part1 = Player.Character.Torso
  149. Weld.C0 = CFrame.new(0, 2.5, 0) * CFrame.fromEulerAnglesXYZ(3.14/2, 0, 0)
  150. SetAngle(1, 3.14)
  151. SetAngle(2, 3.14)
  152. Grabbed = Player
  153. Human.Sit = true
  154. Connection1:disconnect()
  155. Connection2:disconnect()
  156. while true do
  157. if (Weld.Part1 == nil) then
  158. Debounce = false
  159. EnableLimb(1)
  160. EnableLimb(2)
  161. Grabbed = nil
  162. break
  163. elseif (Weld.Parent == nil) then
  164. Debounce = false
  165. EnableLimb(1)
  166. EnableLimb(2)
  167. Grabbed = nil
  168. break
  169. else
  170. Human.Sit = true
  171. end
  172. wait()
  173. end
  174. end
  175. end
  176. end
  177. end
  178. end
  179. end
  180. function Click(mouse)
  181. Hold = true
  182. if (Flight == true) then
  183. Person.Character.Engine.BodyPosition.maxForce = Vector3.new(0, 0, 0)
  184. Person.Character.Engine.BodyVelocity.maxForce = Vector3.new(4e+030, 4e+030, 4e+030)
  185. Position = Person.Character.Engine.Position
  186. Person.Character.Suit["Left Jet Barrel"].Fire.Enabled = true --
  187. Person.Character.Suit["Right Jet Barrel"].Fire.Enabled = true --
  188. Person.Character.Engine.Weld.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(3.14/2, 0, 0)
  189. SetAngle(NormalHand, 3.14)
  190. while true do
  191. if (Flight == false) then
  192. break
  193. end
  194. if (Hold == false) then
  195. break
  196. end
  197. Direction = Person.Character.Engine.CFrame.lookVector
  198. Position = Position + 2 * 3 * Direction
  199. error = Position - Person.Character.Engine.Position
  200. Person.Character.Engine.BodyVelocity.velocity = 2 * error
  201. wait()
  202. end
  203. BodyP.position = Engine.Position
  204. Person.Character.Engine.BodyPosition.maxForce = Vector3.new(4e+050, 4e+050, 4e+050)
  205. Person.Character.Suit["Left Jet Barrel"].Fire.Enabled = false --
  206. Person.Character.Suit["Right Jet Barrel"].Fire.Enabled = false --
  207. Person.Character.Engine.Weld.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  208. SetAngle(NormalHand, 0)
  209.  
  210. end
  211.  
  212. end
  213.  
  214.  
  215. function Release(mouse)
  216. Hold = false
  217. end
  218. function Direct(En, Target)
  219. local OriginCFrame = En:findFirstChild("BodyGyro").cframe
  220. local Direction = (Target - En.Position).unit
  221. local SpawnPosition = En.Position
  222. local Position = SpawnPosition + (Direction * 1)
  223. En:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000, 9000, 9000)
  224. En:findFirstChild("BodyGyro").cframe = CFrame.new(Position, Position + Direction)
  225. end
  226. function PressKey(key, mouse)
  227. key = key:upper()
  228. if (key == "Z") then
  229. if (Debounce == false) then
  230. Debounce = true
  231. DisableLimb(1)
  232. DisableLimb(2)
  233. Joints[1].MaxVelocity = 1
  234. SetAngle(1, 3.14)
  235. Joints[2].MaxVelocity = 1
  236. SetAngle(2, 3.14)
  237. function Touch(Part)
  238. if (Part.Parent ~= nil) then
  239. Human = Part.Parent:findFirstChild("Humanoid")
  240. if (Human ~= nil) then
  241. --Human.Sit = true
  242. Human.Parent.Torso.Velocity = Vector3.new(0, 300, 0)
  243. end
  244. end
  245. end
  246. Connection = Limbs[1].Touched:connect(Touch)
  247. ConnectionB = Limbs[2].Touched:connect(Touch)
  248. wait(0.5)
  249. Joints[1].MaxVelocity = 0.1
  250. Joints[2].MaxVelocity = 0.1
  251. EnableLimb(1)
  252. EnableLimb(2)
  253. Connection:disconnect()
  254. ConnectionB:disconnect()
  255. Debounce = false
  256. end
  257. end
  258. if (key == "U") then
  259. X = game.Workspace:GetChildren()
  260. for I, E in pairs(X) do
  261. if (E.Name == "Bomb") then
  262. Ex = Instance.new("Explosion")
  263. Ex.Parent = game.Workspace
  264. Ex.BlastRadius = 12
  265. Ex.Position = E.Position
  266. Ex.BlastPressure = 1000
  267. E:remove()
  268. end
  269. end
  270. end
  271. if (key == "Y") then
  272. Bomb = Instance.new("Part")
  273. Bomb.Name = "Bomb"
  274. Bomb.formFactor = "Plate"
  275. Bomb.Size = Vector3.new(1, 0.4, 1)
  276. Bomb.TopSurface = 0
  277. Bomb.BottomSurface = 0
  278. Bomb.BrickColor = BrickColor.new("Really black")
  279. Bomb.CFrame = CFrame.new(Person.Character.Suit.Watch2.Position)
  280. Bomb.CanCollide = true
  281. Bomb.Parent = game.Workspace
  282. Smoke = Instance.new("Smoke")
  283. Smoke.Parent = Bomb
  284. local c = (PersonT.Color.r + PersonT.Color.g + PersonT.Color.b)/3
  285. Smoke.Color = Color3.new(c, c, c)
  286. Smoke.Size = 1
  287. Smoke.Opacity = 0.7
  288. Smoke.RiseVelocity = 10
  289. Bomb:BreakJoints()
  290. end
  291. if (key == "Q") then
  292. if (Debounce == false) then
  293. Debounce = true
  294. DisableLimb(NormalFoot)
  295. Joints[NormalFoot].MaxVelocity = 1
  296. SetAngle(NormalFoot, 0.7)
  297. function Touch(Part)
  298. if (Part.Parent ~= nil) then
  299. Human = Part.Parent:findFirstChild("Humanoid")
  300. if (Human ~= nil) then
  301. Human.Sit = true
  302. Position = Human.Parent.Torso.Position
  303. Direction = PersonT.CFrame.lookVector
  304. Position = Position + 10 * 3 * Direction
  305. error = Position - PersonT.Position
  306. Human.Parent.Torso.Velocity = 10 * error
  307. Human.Parent.Torso.Velocity = Human.Parent.Torso.Velocity + Vector3.new(0, 100, 0)
  308. end
  309. end
  310. end
  311. Connection = Limbs[NormalFoot].Touched:connect(Touch)
  312. wait(0.5)
  313. Joints[NormalFoot].MaxVelocity = 0.1
  314. EnableLimb(NormalFoot)
  315. Connection:disconnect()
  316. Debounce = false
  317. end
  318. end
  319. if (key == "F") then
  320. if (Debounce == false) then
  321. Debounce = true
  322. DisableLimb(NormalFoot)
  323. Joints[NormalFoot].MaxVelocity = 1
  324. SetAngle(NormalFoot, 0.7)
  325. function Touch(Part)
  326. if (Part.Parent ~= nil) then
  327. Human = Part.Parent:findFirstChild("Humanoid")
  328. if (Human ~= nil) then
  329. Player = game.Players:GetPlayerFromCharacter(Human.Parent)
  330. if (Player ~= nil) then
  331. if (Player ~= Person) then
  332. Human.Sit = true
  333. Position = Human.Parent.Torso.Position
  334. Direction = PersonT.CFrame.lookVector
  335. Position = Position + 10 * 3 * Direction
  336. error = Position - PersonT.Position
  337. Human.Parent.Torso.Velocity = 10 * error
  338. Human.Parent.Torso.Velocity = Human.Parent.Torso.Velocity + Vector3.new(0, 100, 0)
  339. wait(0.4)
  340. Player:remove()
  341. end
  342. end
  343. end
  344. end
  345. end
  346. Connection = Limbs[NormalFoot].Touched:connect(Touch)
  347. wait(0.5)
  348. Joints[NormalFoot].MaxVelocity = 0.1
  349. EnableLimb(NormalFoot)
  350. Connection:disconnect()
  351. Debounce = false
  352. end
  353. end
  354. if (key == "E") then
  355. if (Flight == true) then
  356. if (FDebounce == false) then
  357. FDebounce = true
  358. function Touch(Part)
  359. if (Part.Parent ~= nil) then
  360. Human = Part.Parent:findFirstChild("Humanoid")
  361. if (Human ~= nil) then
  362. Human.Sit = true
  363. Position = Human.Parent.Torso.Position
  364. Direction = Person.Character.Engine.CFrame.lookVector
  365. Position = Position + 10 * 3 * Direction
  366. error = Position - PersonT.Position
  367. Human.Parent.Torso.Velocity = 10 * error
  368. end
  369. end
  370. end
  371. Connection = PersonT.Touched:connect(Touch)
  372. wait(2)
  373. Connection:disconnect()
  374. FDebounce = false
  375. end
  376. end
  377. if (Debounce == false) then
  378. Debounce = true
  379. DisableLimb(NormalHand)
  380. Joints[NormalHand].MaxVelocity = 1
  381. SetAngle(NormalHand, 1.57)
  382. function Touch(Part)
  383. if (Part.Parent ~= nil) then
  384. Human = Part.Parent:findFirstChild("Humanoid")
  385. if (Human ~= nil) then
  386. Human.Sit = true
  387. Position = Human.Parent.Torso.Position
  388. Direction = PersonT.CFrame.lookVector
  389. Position = Position + 10 * 3 * Direction
  390. error = Position - PersonT.Position
  391. Human.Parent.Torso.Velocity = 10 * error
  392. end
  393. end
  394. end
  395. Connection = Limbs[NormalHand].Touched:connect(Touch)
  396. wait(0.5)
  397. EnableLimb(NormalHand)
  398. Connection:disconnect()
  399. Debounce = false
  400. end
  401. end
  402. if (key == "T") then
  403. E = Instance.new("Explosion")
  404. E.Parent = game.Workspace
  405. E.BlastRadius = 12
  406. E.Position = mouse.hit.p
  407. E.BlastPressure = 1000
  408. end
  409. if (key == "G") then
  410. if (Grabbed == nil) then
  411. if (Debounce == false) then
  412. Debounce = true
  413. DisableLimb(1)
  414. DisableLimb(2)
  415. SetAngle(1, 1.57)
  416. SetAngle(2, 1.57)
  417. Connection1 = Limbs[1].Touched:connect(Grab)
  418. Connection2 = Limbs[2].Touched:connect(Grab)
  419. for E = 1, 30 do
  420. if (Grabbed ~= nil) then
  421. break
  422. end
  423. wait(0.1)
  424. end
  425. if (Grabbed == nil) then
  426. EnableLimb(1)
  427. EnableLimb(2)
  428. Connection1:disconnect()
  429. Connection2:disconnect()
  430. Debounce = false
  431. end
  432. end
  433. else
  434. Person.Character.Torso.Grip:remove()
  435. Position = Grabbed.Character.Torso.Position
  436. Direction = PersonT.CFrame.lookVector
  437. Position = Position + 4 * 3 * Direction
  438. error = Position - PersonT.Position
  439. Grabbed.Character.Torso.Velocity = 4 * error
  440. end
  441. end
  442. if (key == "R") then
  443. if (Flight == false) then
  444. if (Debounce == false) then
  445. Debounce = true
  446. DisableLimb(1)
  447. DisableLimb(2)
  448. Flight = true
  449. DisableLimb(3)
  450. DisableLimb(4)
  451. SetAngle(1, 0)
  452. SetAngle(2, 0)
  453. SetAngle(3, 0)
  454. SetAngle(4, 0)
  455. Engine = Instance.new("Part")
  456. Engine.Parent = Person.Character
  457. Engine.Size = PersonT.Size
  458. Engine.Name = "Engine"
  459. Engine.TopSurface = 0
  460. Engine.BottomSurface = 0
  461. Engine.formFactor = "Symmetric"
  462. Engine.Transparency = 1
  463. Engine:BreakJoints()
  464. Weld = Instance.new("Weld")
  465. Weld.Parent = Engine
  466. Weld.Part0 = PersonT
  467. Weld.Part1 = Engine
  468. Weld.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  469. BodyP = Instance.new("BodyPosition")
  470. BodyP.Parent = Engine
  471. BodyP.position = Engine.Position + Vector3.new(0, 10, 0)
  472. BodyP.maxForce = Vector3.new(4e+050, 4e+050, 4e+050)
  473. BodyG = Instance.new("BodyGyro")
  474. BodyG.Parent = Engine
  475. BodyV = Instance.new("BodyVelocity")
  476. BodyV.Parent = Engine
  477. BodyV.velocity = Vector3.new(0, 0, 0)
  478. BodyV.maxForce = Vector3.new(0, 0, 0)
  479. while true do
  480. if (Flight == false) then
  481. break
  482. end
  483. Direct(Engine, mouse.hit.p)
  484. Person.Character.Humanoid.Sit = true
  485. Person.Character.Head.CanCollide = false
  486. Person.Character.Torso.CanCollide = false
  487. wait(0.000000000000000000000000000000001)
  488. end
  489. EnableLimb(1)
  490. EnableLimb(2)
  491. EnableLimb(3)
  492. EnableLimb(4)
  493. Debounce = false
  494. Person.Character.Engine:remove()
  495. Person.Character.Humanoid.Sit = false
  496. end
  497. else
  498. Flight = false
  499. end
  500. end
  501. if (key == "L") then
  502. DisableLimb(NormalHand)
  503. SetAngle(NormalHand, 1.57)
  504. Smoke = Instance.new("Smoke")
  505. Smoke.Parent = Person.Character.Suit.Band
  506. local c = (PersonT.Color.r + PersonT.Color.g + PersonT.Color.b)/3
  507. Smoke.Color = Color3.new(0, 0, 0)
  508. Smoke.Size = 15
  509. Smoke.Opacity = 1
  510. Smoke.RiseVelocity = -15
  511. end
  512. if (key == "H") then
  513. if (Debounce == false) then
  514. if (Lazer == false) then
  515. if (mouse.Target ~= nil) then
  516. Debounce = true
  517. Lazer = true
  518. DisableLimb(NormalHand)
  519. SetAngle(NormalHand, 0.785)
  520. BP = Instance.new("BodyPosition")
  521. BP.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  522. BP.P = BP.P / 4
  523. BG = Instance.new("BodyGyro")
  524. BG.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  525. local Hit = mouse.Target
  526. local _P = mouse.Hit.p
  527. local Mag = (Hit.Position-_P).magnitude
  528. local Pos = (Hit.Position-_P).unit * -Mag
  529. local CF = Hit.CFrame.lookVector
  530. while true do
  531. if (Lazer == false) then
  532. break
  533. end
  534. BP.Parent = PersonT
  535. BP.position = ((((CFrame.new(Hit.Position + Pos)) + (-CF)) + (Hit.CFrame.lookVector)) + (mouse.Hit.lookVector * -16)).p + Vector3.new(0, 5.7, 0)
  536. BG.Parent = PersonT
  537. BG.cframe = CFrame.new((PersonT.CFrame + (mouse.Hit.lookVector * -8)).p, (Hit.Position + Pos))
  538. if (Hit.Parent == nil) or (Hit.Parent.Parent == Person.Character) then
  539. BP.Parent = nil
  540. BG.Parent = nil
  541. end
  542. local P = Instance.new("Part")
  543. P.Name = "Grapple Lazer"
  544. P.formFactor = 0
  545. P.Parent = Person.Character
  546. P.BrickColor = BrickColor.new(1)
  547. P.Anchored = true
  548. P.Transparency = 0.05
  549. P.Locked = true
  550. P.Reflectance = 0.025
  551. P.CanCollide = false
  552. P.Size = Vector3.new(1, 1, 1)
  553. local mesh = Instance.new("CylinderMesh")
  554. local Place0 = Person.Character.Suit.Watch2.CFrame * CFrame.new(0, -0.1, 0)
  555.  
  556. mesh.Scale = Vector3.new(0.1, (Place0.p - (Hit.Position + Pos)).magnitude, 0.1)
  557. mesh.Parent = P
  558. P.CFrame = CFrame.new((Place0.p + (Hit.Position + Pos))/2, Place0.p) * CFrame.fromEulerAnglesXYZ(math.pi/2, 0, 0)
  559. wait()
  560. P:remove()
  561. end
  562. Debounce = false
  563. EnableLimb(NormalHand)
  564. BP.Parent = nil
  565. BG.Parent = nil
  566. end
  567. end
  568. end
  569. end
  570. if (key == "J") then
  571. if (Debounce == false) then
  572. if (Lazer == false) then
  573. Debounce = true
  574. Lazer = true
  575. DisableLimb(NormalHand)
  576. SetAngle(NormalHand, 0.785)
  577. smokeBrick = Instance.new("Part")
  578. smokeBrick.CanCollide = false
  579. smokeBrick.Anchored = true
  580. smokeBrick.Transparency = 1
  581. smokeBrick.Locked = true
  582. smokeBrick.archivable = false
  583. smokeBrick.TopSurface = 0
  584. smokeBrick.BottomSurface = 0
  585. smoke = Instance.new("Smoke")
  586. smoke.Size = smoke.Size * 4
  587. while true do
  588. if (Lazer == false) then
  589. break
  590. end
  591. local Pos = mouse.Hit.p
  592. smokeBrick.Parent = Person.Character
  593. smokeBrick.CFrame = CFrame.new(Pos)
  594. if (mouse.Target) and (mouse.Target ~= nil) then
  595. smoke.Parent = smokeBrick
  596. local c = (mouse.Target.Color.r + mouse.Target.Color.g + mouse.Target.Color.b)/3
  597. smoke.Color = Color3.new(c, c, c)
  598. end
  599. local L = Instance.new("Part")
  600. L.Parent = Person.Character
  601. L.Name = "Kill Lazer"
  602. L.BrickColor = BrickColor.new(21)
  603. L.formFactor = 0
  604. L.Size = Vector3.new(1, 1, 1)
  605. L.Locked = true
  606. L.Anchored = true
  607. L.CanCollide = false
  608. L.Transparency = 0.05
  609. L.Reflectance = 0.1
  610. local Place0 = Person.Character.Suit.Watch2.CFrame * CFrame.new(0, -0.1, 0)
  611. local Mesh = Instance.new("CylinderMesh")
  612. Mesh.Parent = L
  613. Mesh.Scale = Vector3.new(0.1, (Place0.p - Pos).magnitude, 0.1)
  614. L.CFrame = CFrame.new((Place0.p + Pos)/2, Place0.p) * CFrame.fromEulerAnglesXYZ(math.pi/2, 0, 0)
  615. if (mouse.Target ~= nil) then
  616. if (mouse.Target.Parent.Name:lower() == "") or ("" == "") then
  617. if ("" ~= "") then
  618. mouse.Target.Parent:BreakJoints()
  619. else
  620. mouse.Target:BreakJoints()
  621. end
  622. end
  623. end
  624. wait()
  625. L:Remove()
  626. end
  627. Debounce = false
  628. smokeBrick.Parent = nil
  629. EnableLimb(NormalHand)
  630. end
  631. end
  632. end
  633. if (key == "X") then
  634. if (Debounce == false) then
  635. if (Lazer == false) then
  636. Debounce = true
  637. Lazer = true
  638. DisableLimb(NormalHand)
  639. SetAngle(NormalHand, 0.785)
  640. smokeBrick = Instance.new("Part")
  641. smokeBrick.CanCollide = false
  642. smokeBrick.Anchored = true
  643. smokeBrick.Transparency = 1
  644. smokeBrick.Locked = true
  645. smokeBrick.archivable = false
  646. smokeBrick.TopSurface = 0
  647. smokeBrick.BottomSurface = 0
  648. smoke = Instance.new("Fire")
  649. while true do
  650. if (Lazer == false) then
  651. break
  652. end
  653. local Pos = mouse.Hit.p
  654. smokeBrick.Parent = Person.Character
  655. smokeBrick.CFrame = CFrame.new(Pos)
  656. if (mouse.Target) and (mouse.Target ~= nil) then
  657. smoke.Parent = smokeBrick
  658. local c = (mouse.Target.Color.r + mouse.Target.Color.g + mouse.Target.Color.b)/3
  659. smoke.Color = Color3.new(c, c, c)
  660. end
  661. local L = Instance.new("Part")
  662. L.Parent = Person.Character
  663. L.Name = "Lock Lazer"
  664. L.BrickColor = BrickColor.new("Camo")
  665. L.formFactor = 0
  666. L.Size = Vector3.new(1, 1, 1)
  667. L.Locked = true
  668. L.Anchored = true
  669. L.CanCollide = false
  670. L.Transparency = 0.05
  671. L.Reflectance = 0.1
  672. local Place0 = Person.Character.Suit.Watch2.CFrame * CFrame.new(0, -0.1, 0)
  673. local Mesh = Instance.new("CylinderMesh")
  674. Mesh.Parent = L
  675. Mesh.Scale = Vector3.new(0.1, (Place0.p - Pos).magnitude, 0.1)
  676. L.CFrame = CFrame.new((Place0.p + Pos)/2, Place0.p) * CFrame.fromEulerAnglesXYZ(math.pi/2, 0, 0)
  677. if (mouse.Target ~= nil) then
  678. if (mouse.Target.Parent.Name:lower() == "") or ("" == "") then
  679. if ("" ~= "") then
  680. mouse.Target.Parent.Locked=true
  681. else
  682. mouse.Target.Locked=true
  683. end
  684. end
  685. end
  686. wait()
  687. L:Remove()
  688. end
  689. Debounce = false
  690. smokeBrick.Parent = nil
  691. EnableLimb(NormalHand)
  692. end
  693. end
  694. end
  695. if (key == "C") then
  696. if (Debounce == false) then
  697. if (Lazer == false) then
  698. Debounce = true
  699. Lazer = true
  700. DisableLimb(NormalHand)
  701. SetAngle(NormalHand, 0.785)
  702. smokeBrick = Instance.new("Part")
  703. smokeBrick.CanCollide = false
  704. smokeBrick.Anchored = true
  705. smokeBrick.Transparency = 1
  706. smokeBrick.Locked = true
  707. smokeBrick.archivable = false
  708. smokeBrick.TopSurface = 0
  709. smokeBrick.BottomSurface = 0
  710. smoke = Instance.new("Smoke")
  711. smoke.Size = smoke.Size * 4
  712. while true do
  713. if (Lazer == false) then
  714. break
  715. end
  716. local Pos = mouse.Hit.p
  717. smokeBrick.Parent = Person.Character
  718. smokeBrick.CFrame = CFrame.new(Pos)
  719. if (mouse.Target) and (mouse.Target ~= nil) then
  720. smoke.Parent = smokeBrick
  721. local c = (mouse.Target.Color.r + mouse.Target.Color.g + mouse.Target.Color.b)/3
  722. smoke.Color = Color3.new(c, c, c)
  723. end
  724. local L = Instance.new("Part")
  725. L.Parent = Person.Character
  726. L.Name = "Unlock Lazer"
  727. L.BrickColor = BrickColor.new("Camo")
  728. L.formFactor = 0
  729. L.Size = Vector3.new(1, 1, 1)
  730. L.Locked = true
  731. L.Anchored = true
  732. L.CanCollide = false
  733. L.Transparency = 0.05
  734. L.Reflectance = 0.1
  735. local Place0 = Person.Character.Suit.Watch2.CFrame * CFrame.new(0, -0.1, 0)
  736. local Mesh = Instance.new("CylinderMesh")
  737. Mesh.Parent = L
  738. Mesh.Scale = Vector3.new(0.1, (Place0.p - Pos).magnitude, 0.1)
  739. L.CFrame = CFrame.new((Place0.p + Pos)/2, Place0.p) * CFrame.fromEulerAnglesXYZ(math.pi/2, 0, 0)
  740. if (mouse.Target ~= nil) then
  741. if (mouse.Target.Parent.Name:lower() == "") or ("" == "") then
  742. if ("" ~= "") then
  743. mouse.Target.Parent.Locked=false
  744. else
  745. mouse.Target.Locked=false
  746. end
  747. end
  748. end
  749. wait()
  750. L:Remove()
  751. end
  752. Debounce = false
  753. smokeBrick.Parent = nil
  754. EnableLimb(NormalHand)
  755. end
  756. end
  757. end
  758. if (key == "V") then
  759. if (Debounce == false) then
  760. if (Lazer == false) then
  761. Debounce = true
  762. Lazer = true
  763. DisableLimb(NormalHand)
  764. SetAngle(NormalHand, 0.785)
  765. smokeBrick = Instance.new("Part")
  766. smokeBrick.CanCollide = false
  767. smokeBrick.Anchored = true
  768. smokeBrick.Transparency = 1
  769. smokeBrick.Locked = true
  770. smokeBrick.archivable = false
  771. smokeBrick.TopSurface = 0
  772. smokeBrick.BottomSurface = 0
  773. smoke = Instance.new("Fire")
  774. while true do
  775. if (Lazer == false) then
  776. break
  777. end
  778. local Pos = mouse.Hit.p
  779. smokeBrick.Parent = Person.Character
  780. smokeBrick.CFrame = CFrame.new(Pos)
  781. if (mouse.Target) and (mouse.Target ~= nil) then
  782. smoke.Parent = smokeBrick
  783. local c = (mouse.Target.Color.r + mouse.Target.Color.g + mouse.Target.Color.b)/3
  784. smoke.Color = Color3.new(c, c, c)
  785. end
  786. local L = Instance.new("Part")
  787. L.Parent = Person.Character
  788. L.Name = "Anchor Lazer"
  789. L.BrickColor = BrickColor.new("Bright yellow")
  790. L.formFactor = 0
  791. L.Size = Vector3.new(1, 1, 1)
  792. L.Locked = true
  793. L.Anchored = true
  794. L.CanCollide = false
  795. L.Transparency = 0.05
  796. L.Reflectance = 0.1
  797. local Place0 = Person.Character.Suit.Watch2.CFrame * CFrame.new(0, -0.1, 0)
  798. local Mesh = Instance.new("CylinderMesh")
  799. Mesh.Parent = L
  800. Mesh.Scale = Vector3.new(0.1, (Place0.p - Pos).magnitude, 0.1)
  801. L.CFrame = CFrame.new((Place0.p + Pos)/2, Place0.p) * CFrame.fromEulerAnglesXYZ(math.pi/2, 0, 0)
  802. if (mouse.Target ~= nil) then
  803. if (mouse.Target.Parent.Name:lower() == "") or ("" == "") then
  804. if ("" ~= "") then
  805. mouse.Target.Parent.Anchored=true
  806. else
  807. mouse.Target.Anchored=true
  808. end
  809. end
  810. end
  811. wait()
  812. L:Remove()
  813. end
  814. Debounce = false
  815. smokeBrick.Parent = nil
  816. EnableLimb(NormalHand)
  817. end
  818. end
  819. end
  820. if (key == "B") then
  821. if (Debounce == false) then
  822. if (Lazer == false) then
  823. Debounce = true
  824. Lazer = true
  825. DisableLimb(NormalHand)
  826. SetAngle(NormalHand, 0.785)
  827. smokeBrick = Instance.new("Part")
  828. smokeBrick.CanCollide = false
  829. smokeBrick.Anchored = true
  830. smokeBrick.Transparency = 1
  831. smokeBrick.Locked = true
  832. smokeBrick.archivable = false
  833. smokeBrick.TopSurface = 0
  834. smokeBrick.BottomSurface = 0
  835. smoke = Instance.new("Smoke")
  836. smoke.Size = smoke.Size * 4
  837. while true do
  838. if (Lazer == false) then
  839. break
  840. end
  841. local Pos = mouse.Hit.p
  842. smokeBrick.Parent = Person.Character
  843. smokeBrick.CFrame = CFrame.new(Pos)
  844. if (mouse.Target) and (mouse.Target ~= nil) then
  845. smoke.Parent = smokeBrick
  846. local c = (mouse.Target.Color.r + mouse.Target.Color.g + mouse.Target.Color.b)/3
  847. smoke.Color = Color3.new(c, c, c)
  848. end
  849. local L = Instance.new("Part")
  850. L.Parent = Person.Character
  851. L.Name = "Unanchor Lazer"
  852. L.BrickColor = BrickColor.new("Bright yellow")
  853. L.formFactor = 0
  854. L.Size = Vector3.new(1, 1, 1)
  855. L.Locked = true
  856. L.Anchored = true
  857. L.CanCollide = false
  858. L.Transparency = 0.05
  859. L.Reflectance = 0.1
  860. local Place0 = Person.Character.Suit.Watch2.CFrame * CFrame.new(0, -0.1, 0)
  861. local Mesh = Instance.new("CylinderMesh")
  862. Mesh.Parent = L
  863. Mesh.Scale = Vector3.new(0.1, (Place0.p - Pos).magnitude, 0.1)
  864. L.CFrame = CFrame.new((Place0.p + Pos)/2, Place0.p) * CFrame.fromEulerAnglesXYZ(math.pi/2, 0, 0)
  865. if (mouse.Target ~= nil) then
  866. if (mouse.Target.Parent.Name:lower() == "") or ("" == "") then
  867. if ("" ~= "") then
  868. mouse.Target.Parent.Anchored=false
  869. else
  870. mouse.Target.Anchored=false
  871. end
  872. end
  873. end
  874. wait()
  875. L:Remove()
  876. end
  877. Debounce = false
  878. smokeBrick.Parent = nil
  879. EnableLimb(NormalHand)
  880. end
  881. end
  882. end
  883. if (key == "N") then
  884. if (Debounce == false) then
  885. if (Lazer == false) then
  886. Debounce = true
  887. Lazer = true
  888. DisableLimb(NormalHand)
  889. SetAngle(NormalHand, 0.785)
  890. smokeBrick = Instance.new("Part")
  891. smokeBrick.CanCollide = false
  892. smokeBrick.Anchored = true
  893. smokeBrick.Transparency = 1
  894. smokeBrick.Locked = true
  895. smokeBrick.archivable = false
  896. smokeBrick.TopSurface = 0
  897. smokeBrick.BottomSurface = 0
  898. smoke = Instance.new("Smoke")
  899. smoke.Size = smoke.Size * 4
  900. while true do
  901. if (Lazer == false) then
  902. break
  903. end
  904. local Pos = mouse.Hit.p
  905. smokeBrick.Parent = Person.Character
  906. smokeBrick.CFrame = CFrame.new(Pos)
  907. if (mouse.Target) and (mouse.Target ~= nil) then
  908. smoke.Parent = smokeBrick
  909. local c = (mouse.Target.Color.r + mouse.Target.Color.g + mouse.Target.Color.b)/3
  910. smoke.Color = Color3.new(c, c, c)
  911. end
  912. local L = Instance.new("Part")
  913. L.Parent = Person.Character
  914. L.Name = "Remove Lazer"
  915. L.BrickColor = BrickColor.new("Magenta")
  916. L.formFactor = 0
  917. L.Size = Vector3.new(1, 1, 1)
  918. L.Locked = true
  919. L.Anchored = true
  920. L.CanCollide = false
  921. L.Transparency = 0.05
  922. L.Reflectance = 0.1
  923. local Place0 = Person.Character.Suit.Watch2.CFrame * CFrame.new(0, -0.1, 0)
  924. local Mesh = Instance.new("CylinderMesh")
  925. Mesh.Parent = L
  926. Mesh.Scale = Vector3.new(0.1, (Place0.p - Pos).magnitude, 0.1)
  927. L.CFrame = CFrame.new((Place0.p + Pos)/2, Place0.p) * CFrame.fromEulerAnglesXYZ(math.pi/2, 0, 0)
  928. if (mouse.Target ~= nil) then
  929. if (mouse.Target.Parent.Name:lower() == "") or ("" == "") then
  930. if ("" ~= "") then
  931. mouse.Target.Parent:remove()
  932. else
  933. mouse.Target:remove()
  934. end
  935. end
  936. end
  937. wait()
  938. L:Remove()
  939. end
  940. Debounce = false
  941. smokeBrick.Parent = nil
  942. EnableLimb(NormalHand)
  943. end
  944. end
  945. end
  946. if (key == "K") then
  947. if (Debounce == false) then
  948. if (Lazer == false) then
  949. Debounce = true
  950. Lazer = true
  951. DisableLimb(NormalHand)
  952. SetAngle(NormalHand, 0.785)
  953. BP = Instance.new("BodyPosition")
  954. BP.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  955. BP.P = BP.P / 4
  956. BG = Instance.new("BodyGyro")
  957. BG.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  958. local targ = nil
  959. local Mag = nil
  960. local Pos = nil
  961. while true do
  962. if (Lazer == false) then
  963. break
  964. end
  965. if (mouse.Target ~= nil) and (targ == nil) then
  966. if (mouse.Target.Anchored == false) then
  967. if ((mouse.Hit.p - Person.Character.Suit.Watch2.Position).magnitude <= 10000) then
  968. targ = mouse.Target
  969. BP.Parent = targ
  970. BG.Parent = targ
  971. Mag = (targ.Position - mouse.Hit.p).magnitude
  972. Pos = (targ.Position - mouse.Hit.p).unit * -Mag
  973. end
  974. end
  975. end
  976. local pop = mouse.Hit.p
  977. local G = Instance.new("Part")
  978. G.Parent = Person.Character
  979. G.Name = "Grab Lazer"
  980. G.Anchored = true
  981. G.Locked = true
  982. G.CanCollide = false
  983. G.formFactor = 0
  984. G.Size = Vector3.new(1, 1, 1)
  985. G.BrickColor = BrickColor.new("Royal blue")
  986. G.Reflectance = 0.05
  987. G.Transparency = 0.025
  988. local Place0 = Person.Character.Suit.Watch2.CFrame * CFrame.new(0, -0.1, 0)
  989. local MeAsh = Instance.new("CylinderMesh")
  990. MeAsh.Parent = G
  991. if (targ == nil) or (targ.Anchored == true) then
  992. MeAsh.Scale = Vector3.new(0.1, (Place0.p-pop).magnitude, 0.1)
  993. G.CFrame = CFrame.new((Place0.p + pop)/2, Place0.p) * CFrame.fromEulerAnglesXYZ(math.pi/2, 0, 0)
  994. else
  995. BP.Parent = targ
  996. BP.position = (PersonT.CFrame + (mouse.Hit.lookVector * 8) + Pos).p + Vector3.new(0, 5.7, 0)
  997. BG.Parent = targ
  998. BG.cframe = CFrame.new(targ.Position, PersonT.Position)
  999. if (targ.Parent == nil) or (targ.Parent.Parent == Person.Character) then
  1000. BP.Parent = nil
  1001. BG.Parent = nil
  1002. end
  1003. MeAsh.Scale = Vector3.new(0.1, (Place0.p - targ.Position).magnitude, 0.1)
  1004. G.CFrame = CFrame.new((Place0.p + (targ.Position + Pos))/2, Place0.p) * CFrame.fromEulerAnglesXYZ(math.pi/2, 0, 0)
  1005. end
  1006. wait()
  1007. G:Remove()
  1008. end
  1009. Debounce = false
  1010. EnableLimb(NormalHand)
  1011. BP.Parent = nil
  1012. BG.Parent = nil
  1013. end
  1014. end
  1015. end
  1016. end
  1017. function LiftKey(key, mouse)
  1018. key = key:upper()
  1019. if (key == "L") then
  1020. if (Person.Character.Suit.Band:findFirstChild("Smoke") ~= nil) then
  1021. Person.Character.Suit.Band.Smoke:remove()
  1022. EnableLimb(NormalHand)
  1023. end
  1024. end
  1025. if (key == "H") then
  1026. if (Person.Character:findFirstChild("Grapple Lazer") ~= nil) then
  1027. Lazer = false
  1028. end
  1029. end
  1030. if (key == "J") then
  1031. if (Person.Character:findFirstChild("Kill Lazer") ~= nil) then
  1032. Lazer = false
  1033. end
  1034. end
  1035. if (key == "K") then
  1036. if (Person.Character:findFirstChild("Grab Lazer") ~= nil) then
  1037. Lazer = false
  1038. end
  1039. end
  1040. if (key == "X") then
  1041. if (Person.Character:findFirstChild("Lock Lazer") ~= nil) then
  1042. Lazer = false
  1043. end
  1044. end
  1045. if (key == "C") then
  1046. if (Person.Character:findFirstChild("Unlock Lazer") ~= nil) then
  1047. Lazer = false
  1048. end
  1049. end
  1050. if (key == "V") then
  1051. if (Person.Character:findFirstChild("Anchor Lazer") ~= nil) then
  1052. Lazer = false
  1053. end
  1054. end
  1055. if (key == "B") then
  1056. if (Person.Character:findFirstChild("Unanchor Lazer") ~= nil) then
  1057. Lazer = false
  1058. end
  1059. end
  1060. if (key == "N") then
  1061. if (Person.Character:findFirstChild("Remove Lazer") ~= nil) then
  1062. Lazer = false
  1063. end
  1064. end
  1065. end
  1066. function Select(mouse)
  1067. mouse.Button1Down:connect(function() Click(mouse) end)
  1068. mouse.Button1Up:connect(function() Release(mouse) end)
  1069. mouse.KeyDown:connect(function(key) PressKey(key, mouse) end)
  1070. mouse.KeyUp:connect(function(key) LiftKey(key, mouse) end)
  1071. end
  1072. function Deselect(mouse)
  1073. Hold = false
  1074. Lazer = false
  1075. Flight = false
  1076. end
  1077. Bin.Selected:connect(Select)
  1078. Bin.Deselected:connect(Deselect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement