Advertisement
Guest User

JetPackHandler

a guest
Feb 13th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.53 KB | None | 0 0
  1. local module = require(game:GetService("ReplicatedStorage"):WaitForChild("GameLoader"))
  2. local jetpackassets = module.jetpackassets
  3. wait(0.25)
  4. repeat
  5. repeat
  6. wait(0.25)
  7. print("waiting for soundsearch")
  8. until _G.searchsounds
  9. until type(_G.searchsounds) == "function"
  10. local player = game.Players.LocalPlayer
  11. repeat
  12. wait()
  13. until player
  14. local pgui = player.PlayerGui
  15. repeat
  16. wait()
  17. until pgui
  18. local character = player.Character
  19. repeat
  20. wait()
  21. until character
  22. local humanoid = character:WaitForChild("Humanoid")
  23. local camera = game:GetService("Workspace").CurrentCamera
  24. repeat
  25. wait()
  26. until camera
  27. local equipkey = jetpackassets.equipkey
  28. local forwardkey = jetpackassets.forwardkey
  29. local jfunction = jetpackassets.jfunction
  30. local jetpacktab = jetpackassets.jetpack1
  31. local jetpackname = jetpacktab.Name
  32. local maxfuel = jetpacktab.MaxFuel
  33. local maxspeed = jetpacktab.MaxSpeed
  34. local hoverspeed = (math.floor)(maxspeed / 1.5)
  35. local fuel = script:WaitForChild("Fuel")
  36. fuel.Value = maxfuel
  37. local speed = 0
  38. local mainpart = character:WaitForChild("Torso")
  39. local boosters = {}
  40. local hoverkey = "h"
  41. local hovermode = false
  42. local jengine1 = (_G.searchsounds)("JetEngine1")
  43. local jengine2 = (_G.searchsounds)("JetEngine2")
  44. local hoversound = ((_G.searchsounds)("Hover"))
  45. local selection = nil
  46. local primarycolor = script:WaitForChild("Pcolor")
  47. local secondarycolor = script:WaitForChild("Scolor")
  48. local basecolor = script:WaitForChild("Bcolor")
  49. local gui = script:WaitForChild("JCustomize"):Clone()
  50. gui.Parent = pgui
  51. local frame = gui:WaitForChild("Frame")
  52. local arrow = frame:WaitForChild("Arrow")
  53. local colorframe = frame:WaitForChild("ColorFrame")
  54. local colframe = frame:WaitForChild("ColFrame")
  55. local primary = colframe:WaitForChild("Primary")
  56. local secondary = colframe:WaitForChild("Secondary")
  57. local base = colframe:WaitForChild("Base")
  58. local customframe = frame:WaitForChild("CustomFrame")
  59. local customize = customframe:WaitForChild("Customize")
  60. local fueltext = customframe:WaitForChild("Fueltext")
  61. local ctoggle = false
  62. local events = {}
  63. local mouse = player:GetMouse()
  64. local fire = false
  65. local equipped = false
  66. local jetpack = nil
  67. local hold = false
  68. local stap = false
  69. local forward = false
  70. local died = false
  71. local sdebounce = false
  72. local flying = false
  73. local collide = false
  74. local cevents = {}
  75. local dhold = false
  76. local ahold = false
  77. local shold = false
  78. local ytilt = 0
  79. local xtilt = 0
  80. local yval = 15
  81. local xval = 20
  82. print("Jetpack variables loaded")
  83. creatextilt = function(bv, torso)
  84. -- function num : 0_0 , upvalues : shold, forward, xtilt, xval, speed
  85. if shold and not forward then
  86. xtilt = xval
  87. bv.velocity = (Vector3.new)(-torso.CFrame.lookVector.X, 0, -torso.CFrame.lookVector.Z) * speed
  88. else
  89. if forward and not shold then
  90. xtilt = -xval
  91. bv.velocity = (Vector3.new)(torso.CFrame.lookVector.X, 0, torso.CFrame.lookVector.Z) * speed
  92. else
  93. xtilt = 0
  94. bv.velocity = (Vector3.new)(0, 0.15, 0)
  95. speed = 0
  96. end
  97. end
  98. end
  99.  
  100. createytilt = function()
  101. -- function num : 0_1 , upvalues : dhold, ahold, ytilt, yval
  102. if dhold and not ahold then
  103. ytilt = ytilt + yval
  104. else
  105. if ahold and not dhold then
  106. ytilt = ytilt - yval
  107. end
  108. end
  109. end
  110.  
  111. stopsounds = function()
  112. -- function num : 0_2 , upvalues : jengine1, jengine2, hoversound
  113. if jengine1.IsPlaying or jengine2.IsPlaying or hoversound.IsPlaying then
  114. jengine1:Stop()
  115. jengine2:Stop()
  116. hoversound:Stop()
  117. end
  118. end
  119.  
  120. togglec = function()
  121. -- function num : 0_3 , upvalues : ctoggle
  122. if not ctoggle then
  123. ctoggle = true
  124. else
  125. if ctoggle then
  126. ctoggle = false
  127. end
  128. end
  129. end
  130.  
  131. handlefuel = function()
  132. -- function num : 0_4 , upvalues : fuel, maxfuel, fueltext
  133. -- DECOMPILER ERROR at PC7: Confused about usage of register: R0 in 'UnsetPending'
  134.  
  135. if maxfuel < fuel.Value then
  136. fuel.Value = maxfuel
  137. else
  138. -- DECOMPILER ERROR at PC14: Confused about usage of register: R0 in 'UnsetPending'
  139.  
  140. if fuel.Value <= 0 then
  141. fuel.Value = 0
  142. end
  143. end
  144. -- DECOMPILER ERROR at PC21: Confused about usage of register: R0 in 'UnsetPending'
  145.  
  146. if fuel.Value == maxfuel then
  147. fueltext.Text = "Fuel: 100%"
  148. else
  149. -- DECOMPILER ERROR at PC28: Confused about usage of register: R0 in 'UnsetPending'
  150.  
  151. if fuel.Value == 0 then
  152. fueltext.Text = "Fuel: 0%"
  153. else
  154. -- DECOMPILER ERROR at PC52: Confused about usage of register: R0 in 'UnsetPending'
  155.  
  156. if fuel.Value >= 10 then
  157. fueltext.Text = "Fuel: " .. (string.sub)(tostring((math.floor)(fuel.Value) / maxfuel), 3, 4) .. "%"
  158. else
  159. -- DECOMPILER ERROR at PC72: Confused about usage of register: R0 in 'UnsetPending'
  160.  
  161. fueltext.Text = "Fuel: " .. (string.sub)(tostring((math.floor)(fuel.Value) / maxfuel), 4, 4) .. "%"
  162. end
  163. end
  164. end
  165. end
  166.  
  167. fuel.Changed:connect(handlefuel)
  168. getcolor = function(t, c)
  169. -- function num : 0_5 , upvalues : equipped, jetpack, jfunction
  170. if equipped and jetpack ~= nil and t and type(t) == "string" then
  171. local group = jfunction:InvokeServer({"color", jetpack:WaitForChild(t), c})
  172. end
  173. end
  174.  
  175. disconnect = function(t)
  176. -- function num : 0_6
  177. if t and type(t) == "table" then
  178. for i,v in pairs(t) do
  179. v:disconnect()
  180. end
  181. t = {}
  182. end
  183. end
  184.  
  185. handlecollisions = function()
  186. -- function num : 0_7 , upvalues : cevents, equipped, jetpack, character, module, collide
  187. disconnect(cevents)
  188. if equipped and jetpack ~= nil then
  189. for i,v in pairs(character:GetChildren()) do
  190. if v:IsA("Part") then
  191. local con = nil
  192. con = v.Touched:connect((module.debounce)(function(p)
  193. -- function num : 0_7_0 , upvalues : jetpack, collide, cevents
  194. if p:IsA("Part") and not p:IsDescendantOf(jetpack) and p.CanCollide then
  195. collide = true
  196. print(p.Name)
  197. disconnect(cevents)
  198. end
  199. wait(0.5)
  200. collide = false
  201. end
  202. ))
  203. ;
  204. (table.insert)(cevents, con)
  205. end
  206. end
  207. end
  208. end
  209.  
  210. arrow.MouseButton1Click:connect((module.debounce)(function()
  211. -- function num : 0_8 , upvalues : ctoggle, arrow, customframe, colframe, colorframe
  212. togglec()
  213. -- DECOMPILER ERROR at PC6: Confused about usage of register: R0 in 'UnsetPending'
  214.  
  215. if ctoggle then
  216. arrow.Rotation = 180
  217. -- DECOMPILER ERROR at PC8: Confused about usage of register: R0 in 'UnsetPending'
  218.  
  219. customframe.Visible = true
  220. -- DECOMPILER ERROR at PC10: Confused about usage of register: R0 in 'UnsetPending'
  221.  
  222. colframe.Visible = false
  223. else
  224. -- DECOMPILER ERROR at PC13: Confused about usage of register: R0 in 'UnsetPending'
  225.  
  226. arrow.Rotation = 0
  227. -- DECOMPILER ERROR at PC15: Confused about usage of register: R0 in 'UnsetPending'
  228.  
  229. customframe.Visible = false
  230. -- DECOMPILER ERROR at PC17: Confused about usage of register: R0 in 'UnsetPending'
  231.  
  232. colframe.Visible = false
  233. -- DECOMPILER ERROR at PC23: Confused about usage of register: R0 in 'UnsetPending'
  234.  
  235. if colorframe.Visible then
  236. colorframe.Visible = false
  237. end
  238. end
  239. wait(0.25)
  240. end
  241. ))
  242. customize.MouseButton1Click:connect((module.debounce)(function()
  243. -- function num : 0_9 , upvalues : customize, equipped, colframe, colorframe, selection, events
  244. if not customize.Visible then
  245. print("Customize is not visible")
  246. return
  247. end
  248. if not equipped then
  249. print("Jetpack is not equipped, can\'t customize")
  250. return
  251. end
  252. -- DECOMPILER ERROR at PC20: Confused about usage of register: R0 in 'UnsetPending'
  253.  
  254. if colframe.Visib...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement