Advertisement
HEHEJ

Untitled

Mar 15th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.62 KB | None | 0 0
  1.  
  2. local option = false
  3.  
  4.  
  5. script.Parent.MouseButton1Down:Connect(function()
  6. if option == false then
  7. script.Parent.BackgroundColor3 = Color3(0,255,0)
  8. option = true
  9.  
  10. --Fly
  11.  
  12. local toggle = false
  13. Fly.MouseButton1Click:Connect(function()
  14. toggle = not toggle
  15. FlyOnOff.BackgroundColor3 = (toggle and Color3.fromRGB(85, 255, 127) or Color3.fromRGB(255, 0, 0))
  16. if toggle then
  17. flying = not flying
  18. repeat wait()
  19. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  20. local mouse = game.Players.LocalPlayer:GetMouse()
  21. repeat wait() until mouse
  22. local plr = game.Players.LocalPlayer
  23. local torso = plr.Character.Torso
  24. local deb = true
  25. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  26. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  27. local maxspeed = 200
  28. local speed = 0
  29. if flying then
  30. end
  31.  
  32. function FlyFunction()
  33. local bg = Instance.new("BodyGyro", torso)
  34. bg.P = 9e4
  35. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  36. bg.cframe = torso.CFrame
  37. local bv = Instance.new("BodyVelocity", torso)
  38. bv.velocity = Vector3.new(0,0.1,0)
  39. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  40. repeat wait()
  41. plr.Character.Humanoid.PlatformStand = true
  42. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  43. speed = speed+.5+(speed/maxspeed)
  44. if speed > maxspeed then
  45. speed = maxspeed
  46. end
  47. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  48. speed = speed-1
  49. if speed < 0 then
  50. speed = 0
  51. end
  52. end
  53. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  54. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  55. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  56. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  57. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  58. else
  59. bv.velocity = Vector3.new(0,0.1,0)
  60. end
  61. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  62. until not flying
  63. ctrl = {f = 0, b = 0, l = 0, r = 0}
  64. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  65. speed = 0
  66. bg:Destroy()
  67. bv:Destroy()
  68. plr.Character.Humanoid.PlatformStand = false
  69. end
  70. mouse.KeyDown:connect(function(key)
  71. if key:lower() == "w" then
  72. ctrl.f = 1
  73. elseif key:lower() == "s" then
  74. ctrl.b = -1
  75. elseif key:lower() == "a" then
  76. ctrl.l = -1
  77. elseif key:lower() == "d" then
  78. ctrl.r = 1
  79.  
  80. end
  81. end)
  82. mouse.KeyUp:connect(function(key)
  83. if key:lower() == "w" then
  84. ctrl.f = 0
  85. elseif key:lower() == "s" then
  86. ctrl.b = 0
  87. elseif key:lower() == "a" then
  88. ctrl.l = 0
  89. elseif key:lower() == "d" then
  90. ctrl.r = 0
  91. end
  92. end)
  93. FlyFunction()
  94. else
  95. flying = not flying
  96. repeat wait()
  97. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  98. local mouse = game.Players.LocalPlayer:GetMouse()
  99. repeat wait() until mouse
  100. local plr = game.Players.LocalPlayer
  101. local torso = plr.Character.Torso
  102. local deb = true
  103. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  104. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  105. local maxspeed = 200
  106. local speed = 0
  107. if flying then
  108. end
  109.  
  110. function FlyFunction()
  111. local bg = Instance.new("BodyGyro", torso)
  112. bg.P = 9e4
  113. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  114. bg.cframe = torso.CFrame
  115. local bv = Instance.new("BodyVelocity", torso)
  116. bv.velocity = Vector3.new(0,0.1,0)
  117. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  118. repeat wait()
  119. plr.Character.Humanoid.PlatformStand = true
  120. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  121. speed = speed+.5+(speed/maxspeed)
  122. if speed > maxspeed then
  123. speed = maxspeed
  124. end
  125. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  126. speed = speed-1
  127. if speed < 0 then
  128. speed = 0
  129. end
  130. end
  131. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  132. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  133. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  134. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  135. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  136. else
  137. bv.velocity = Vector3.new(0,0.1,0)
  138. end
  139. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  140. until not flying
  141. ctrl = {f = 0, b = 0, l = 0, r = 0}
  142. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  143. speed = 0
  144. bg:Destroy()
  145. bv:Destroy()
  146. plr.Character.Humanoid.PlatformStand = false
  147. end
  148. mouse.KeyDown:connect(function(key)
  149. if key:lower() == "w" then
  150. ctrl.f = 1
  151. elseif key:lower() == "s" then
  152. ctrl.b = -1
  153. elseif key:lower() == "a" then
  154. ctrl.l = -1
  155. elseif key:lower() == "d" then
  156. ctrl.r = 1
  157.  
  158. end
  159. end)
  160. mouse.KeyUp:connect(function(key)
  161. if key:lower() == "w" then
  162. ctrl.f = 0
  163. elseif key:lower() == "s" then
  164. ctrl.b = 0
  165. elseif key:lower() == "a" then
  166. ctrl.l = 0
  167. elseif key:lower() == "d" then
  168. ctrl.r = 0
  169. end
  170. end)
  171. FlyFunction()
  172. end
  173. end)
  174.  
  175. elseif option == true then
  176.  
  177. script.Parent.BackgroundColor3 = Color3(255,0,0)
  178. option = true
  179.  
  180. --Fly
  181.  
  182. local toggle = false
  183. Fly.MouseButton1Click:Connect(function()
  184. toggle = not toggle
  185. FlyOnOff.BackgroundColor3 = (toggle and Color3.fromRGB(85, 255, 127) or Color3.fromRGB(255, 0, 0))
  186. if toggle then
  187. flying = not flying
  188. repeat wait()
  189. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  190. local mouse = game.Players.LocalPlayer:GetMouse()
  191. repeat wait() until mouse
  192. local plr = game.Players.LocalPlayer
  193. local torso = plr.Character.Torso
  194. local deb = true
  195. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  196. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  197. local maxspeed = 200
  198. local speed = 0
  199. if flying then
  200. end
  201.  
  202. function FlyFunction()
  203. local bg = Instance.new("BodyGyro", torso)
  204. bg.P = 9e4
  205. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  206. bg.cframe = torso.CFrame
  207. local bv = Instance.new("BodyVelocity", torso)
  208. bv.velocity = Vector3.new(0,0.1,0)
  209. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  210. repeat wait()
  211. plr.Character.Humanoid.PlatformStand = true
  212. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  213. speed = speed+.5+(speed/maxspeed)
  214. if speed > maxspeed then
  215. speed = maxspeed
  216. end
  217. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  218. speed = speed-1
  219. if speed < 0 then
  220. speed = 0
  221. end
  222. end
  223. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  224. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  225. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  226. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  227. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  228. else
  229. bv.velocity = Vector3.new(0,0.1,0)
  230. end
  231. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  232. until not flying
  233. ctrl = {f = 0, b = 0, l = 0, r = 0}
  234. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  235. speed = 0
  236. bg:Destroy()
  237. bv:Destroy()
  238. plr.Character.Humanoid.PlatformStand = false
  239. end
  240. mouse.KeyDown:connect(function(key)
  241. if key:lower() == "w" then
  242. ctrl.f = 1
  243. elseif key:lower() == "s" then
  244. ctrl.b = -1
  245. elseif key:lower() == "a" then
  246. ctrl.l = -1
  247. elseif key:lower() == "d" then
  248. ctrl.r = 1
  249.  
  250. end
  251. end)
  252. mouse.KeyUp:connect(function(key)
  253. if key:lower() == "w" then
  254. ctrl.f = 0
  255. elseif key:lower() == "s" then
  256. ctrl.b = 0
  257. elseif key:lower() == "a" then
  258. ctrl.l = 0
  259. elseif key:lower() == "d" then
  260. ctrl.r = 0
  261. end
  262. end)
  263. FlyFunction()
  264. else
  265. flying = not flying
  266. repeat wait()
  267. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  268. local mouse = game.Players.LocalPlayer:GetMouse()
  269. repeat wait() until mouse
  270. local plr = game.Players.LocalPlayer
  271. local torso = plr.Character.Torso
  272. local deb = true
  273. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  274. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  275. local maxspeed = 200
  276. local speed = 0
  277. if flying then
  278. end
  279.  
  280. function FlyFunction()
  281. local bg = Instance.new("BodyGyro", torso)
  282. bg.P = 9e4
  283. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  284. bg.cframe = torso.CFrame
  285. local bv = Instance.new("BodyVelocity", torso)
  286. bv.velocity = Vector3.new(0,0.1,0)
  287. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  288. repeat wait()
  289. plr.Character.Humanoid.PlatformStand = true
  290. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  291. speed = speed+.5+(speed/maxspeed)
  292. if speed > maxspeed then
  293. speed = maxspeed
  294. end
  295. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  296. speed = speed-1
  297. if speed < 0 then
  298. speed = 0
  299. end
  300. end
  301. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  302. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  303. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  304. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  305. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  306. else
  307. bv.velocity = Vector3.new(0,0.1,0)
  308. end
  309. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  310. until not flying
  311. ctrl = {f = 0, b = 0, l = 0, r = 0}
  312. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  313. speed = 0
  314. bg:Destroy()
  315. bv:Destroy()
  316. plr.Character.Humanoid.PlatformStand = false
  317. end
  318. mouse.KeyDown:connect(function(key)
  319. if key:lower() == "w" then
  320. ctrl.f = 1
  321. elseif key:lower() == "s" then
  322. ctrl.b = -1
  323. elseif key:lower() == "a" then
  324. ctrl.l = -1
  325. elseif key:lower() == "d" then
  326. ctrl.r = 1
  327.  
  328. end
  329. end)
  330. mouse.KeyUp:connect(function(key)
  331. if key:lower() == "w" then
  332. ctrl.f = 0
  333. elseif key:lower() == "s" then
  334. ctrl.b = 0
  335. elseif key:lower() == "a" then
  336. ctrl.l = 0
  337. elseif key:lower() == "d" then
  338. ctrl.r = 0
  339. end
  340. end)
  341. FlyFunction()
  342. end
  343. end)
  344. end
  345. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement