Messi33536086

Untitled

Mar 11th, 2026
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.77 KB | None | 0 0
  1. -- 🚀 MODERN FLY GUI V3 (2026 Edition)
  2. -- 100% SAME flying mechanics as your original (R6/R15 support, tpwalking, speed system, up/down hold, etc.)
  3. -- ✅ Modern dark/neon theme | UICorner + UIStroke everywhere | Smooth Tween animations | PC + Mobile drag
  4. -- ✅ Minimize with slide animation | Hover effects | Toggle color change | Better layout
  5.  
  6. local TweenService = game:GetService("TweenService")
  7. local UserInputService = game:GetService("UserInputService")
  8. local RunService = game:GetService("RunService")
  9. local StarterGui = game:GetService("StarterGui")
  10. local Players = game:GetService("Players")
  11.  
  12. local player = Players.LocalPlayer
  13. local playerGui = player:WaitForChild("PlayerGui")
  14.  
  15. -- ==================== CREATE GUI ====================
  16. local screenGui = Instance.new("ScreenGui")
  17. screenGui.Name = "ModernFlyGuiV3"
  18. screenGui.ResetOnSpawn = false
  19. screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  20. screenGui.Parent = playerGui
  21.  
  22. local mainFrame = Instance.new("Frame")
  23. mainFrame.Name = "MainFrame"
  24. mainFrame.Parent = screenGui
  25. mainFrame.BackgroundColor3 = Color3.fromRGB(18, 18, 28)
  26. mainFrame.BorderSizePixel = 0
  27. mainFrame.Position = UDim2.new(0.1, 0, 0.35, 0)
  28. mainFrame.Size = UDim2.new(0, 250, 0, 190)
  29. mainFrame.Active = true
  30.  
  31. local mainCorner = Instance.new("UICorner")
  32. mainCorner.CornerRadius = UDim.new(0, 16)
  33. mainCorner.Parent = mainFrame
  34.  
  35. local mainStroke = Instance.new("UIStroke")
  36. mainStroke.Thickness = 2.5
  37. mainStroke.Color = Color3.fromRGB(0, 255, 200)
  38. mainStroke.Parent = mainFrame
  39.  
  40. -- Title Bar (draggable area)
  41. local titleBar = Instance.new("Frame")
  42. titleBar.Name = "TitleBar"
  43. titleBar.Parent = mainFrame
  44. titleBar.BackgroundColor3 = Color3.fromRGB(12, 12, 22)
  45. titleBar.BorderSizePixel = 0
  46. titleBar.Size = UDim2.new(1, 0, 0, 38)
  47.  
  48. local titleCorner = Instance.new("UICorner")
  49. titleCorner.CornerRadius = UDim.new(0, 16)
  50. titleCorner.Parent = titleBar
  51.  
  52. local titleLabel = Instance.new("TextLabel")
  53. titleLabel.Name = "Title"
  54. titleLabel.Parent = titleBar
  55. titleLabel.BackgroundTransparency = 1
  56. titleLabel.Position = UDim2.new(0, 15, 0.5, -10)
  57. titleLabel.Size = UDim2.new(0.55, 0, 1, -10)
  58. titleLabel.Font = Enum.Font.GothamBold
  59. titleLabel.Text = "FLY GUI V3"
  60. titleLabel.TextColor3 = Color3.fromRGB(0, 255, 200)
  61. titleLabel.TextScaled = true
  62. titleLabel.TextXAlignment = Enum.TextXAlignment.Left
  63.  
  64. -- Close Button
  65. local closeButton = Instance.new("TextButton")
  66. closeButton.Name = "Close"
  67. closeButton.Parent = titleBar
  68. closeButton.BackgroundColor3 = Color3.fromRGB(255, 60, 60)
  69. closeButton.Position = UDim2.new(1, -38, 0.5, -13)
  70. closeButton.Size = UDim2.new(0, 28, 0, 28)
  71. closeButton.Font = Enum.Font.GothamBold
  72. closeButton.Text = "✕"
  73. closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  74. closeButton.TextSize = 18
  75.  
  76. local closeCorner = Instance.new("UICorner")
  77. closeCorner.CornerRadius = UDim.new(0, 8)
  78. closeCorner.Parent = closeButton
  79.  
  80. -- Minimize Button
  81. local miniButton = Instance.new("TextButton")
  82. miniButton.Name = "Minimize"
  83. miniButton.Parent = titleBar
  84. miniButton.BackgroundColor3 = Color3.fromRGB(70, 70, 255)
  85. miniButton.Position = UDim2.new(1, -73, 0.5, -13)
  86. miniButton.Size = UDim2.new(0, 28, 0, 28)
  87. miniButton.Font = Enum.Font.GothamBold
  88. miniButton.Text = "−"
  89. miniButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  90. miniButton.TextSize = 22
  91.  
  92. local miniCorner = Instance.new("UICorner")
  93. miniCorner.CornerRadius = UDim.new(0, 8)
  94. miniCorner.Parent = miniButton
  95.  
  96. -- Maximize Button (hidden at start)
  97. local mini2Button = Instance.new("TextButton")
  98. mini2Button.Name = "Maximize"
  99. mini2Button.Parent = titleBar
  100. mini2Button.BackgroundColor3 = Color3.fromRGB(70, 70, 255)
  101. mini2Button.Position = UDim2.new(1, -73, 0.5, -13)
  102. mini2Button.Size = UDim2.new(0, 28, 0, 28)
  103. mini2Button.Font = Enum.Font.GothamBold
  104. mini2Button.Text = "+"
  105. mini2Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  106. mini2Button.TextSize = 20
  107. mini2Button.Visible = false
  108.  
  109. local mini2Corner = Instance.new("UICorner")
  110. mini2Corner.CornerRadius = UDim.new(0, 8)
  111. mini2Corner.Parent = mini2Button
  112.  
  113. -- Content Area
  114. local content = Instance.new("Frame")
  115. content.Name = "Content"
  116. content.Parent = mainFrame
  117. content.BackgroundTransparency = 1
  118. content.Position = UDim2.new(0, 0, 0, 40)
  119. content.Size = UDim2.new(1, 0, 1, -40)
  120.  
  121. -- FLY Toggle
  122. local onof = Instance.new("TextButton")
  123. onof.Name = "onof"
  124. onof.Parent = content
  125. onof.BackgroundColor3 = Color3.fromRGB(255, 70, 70)
  126. onof.Position = UDim2.new(0.5, -60, 0.08, 0)
  127. onof.Size = UDim2.new(0, 120, 0, 45)
  128. onof.Font = Enum.Font.GothamBold
  129. onof.Text = "FLY OFF"
  130. onof.TextColor3 = Color3.fromRGB(255, 255, 255)
  131. onof.TextSize = 18
  132.  
  133. local onofCorner = Instance.new("UICorner")
  134. onofCorner.CornerRadius = UDim.new(0, 12)
  135. onofCorner.Parent = onof
  136.  
  137. local onofStroke = Instance.new("UIStroke")
  138. onofStroke.Thickness = 2
  139. onofStroke.Color = Color3.fromRGB(255, 255, 255)
  140. onofStroke.Parent = onof
  141.  
  142. -- Speed Section
  143. local speedContainer = Instance.new("Frame")
  144. speedContainer.Name = "SpeedContainer"
  145. speedContainer.Parent = content
  146. speedContainer.BackgroundTransparency = 1
  147. speedContainer.Position = UDim2.new(0.5, -75, 0.38, 0)
  148. speedContainer.Size = UDim2.new(0, 150, 0, 38)
  149.  
  150. local mine = Instance.new("TextButton")
  151. mine.Name = "mine"
  152. mine.Parent = speedContainer
  153. mine.BackgroundColor3 = Color3.fromRGB(80, 80, 255)
  154. mine.Size = UDim2.new(0, 38, 0, 38)
  155. mine.Font = Enum.Font.GothamBold
  156. mine.Text = "−"
  157. mine.TextColor3 = Color3.fromRGB(255, 255, 255)
  158. mine.TextSize = 26
  159.  
  160. local mineCorner = Instance.new("UICorner")
  161. mineCorner.CornerRadius = UDim.new(0, 10)
  162. mineCorner.Parent = mine
  163.  
  164. local speed = Instance.new("TextLabel")
  165. speed.Name = "speed"
  166. speed.Parent = speedContainer
  167. speed.BackgroundColor3 = Color3.fromRGB(30, 30, 45)
  168. speed.Position = UDim2.new(0, 42, 0, 0)
  169. speed.Size = UDim2.new(0, 66, 0, 38)
  170. speed.Font = Enum.Font.GothamBold
  171. speed.Text = "1"
  172. speed.TextColor3 = Color3.fromRGB(0, 255, 200)
  173. speed.TextScaled = true
  174.  
  175. local speedCorner = Instance.new("UICorner")
  176. speedCorner.CornerRadius = UDim.new(0, 10)
  177. speedCorner.Parent = speed
  178.  
  179. local speedStroke = Instance.new("UIStroke")
  180. speedStroke.Thickness = 1.5
  181. speedStroke.Color = Color3.fromRGB(0, 255, 200)
  182. speedStroke.Parent = speed
  183.  
  184. local plus = Instance.new("TextButton")
  185. plus.Name = "plus"
  186. plus.Parent = speedContainer
  187. plus.BackgroundColor3 = Color3.fromRGB(80, 80, 255)
  188. plus.Position = UDim2.new(0, 112, 0, 0)
  189. plus.Size = UDim2.new(0, 38, 0, 38)
  190. plus.Font = Enum.Font.GothamBold
  191. plus.Text = "+"
  192. plus.TextColor3 = Color3.fromRGB(255, 255, 255)
  193. plus.TextSize = 26
  194.  
  195. local plusCorner = Instance.new("UICorner")
  196. plusCorner.CornerRadius = UDim.new(0, 10)
  197. plusCorner.Parent = plus
  198.  
  199. -- UP Button
  200. local up = Instance.new("TextButton")
  201. up.Name = "up"
  202. up.Parent = content
  203. up.BackgroundColor3 = Color3.fromRGB(80, 255, 140)
  204. up.Position = UDim2.new(0.12, 0, 0.68, 0)
  205. up.Size = UDim2.new(0, 88, 0, 42)
  206. up.Font = Enum.Font.GothamBold
  207. up.Text = "↑ UP"
  208. up.TextColor3 = Color3.fromRGB(0, 0, 0)
  209. up.TextSize = 17
  210.  
  211. local upCorner = Instance.new("UICorner")
  212. upCorner.CornerRadius = UDim.new(0, 12)
  213. upCorner.Parent = up
  214.  
  215. -- DOWN Button
  216. local down = Instance.new("TextButton")
  217. down.Name = "down"
  218. down.Parent = content
  219. down.BackgroundColor3 = Color3.fromRGB(255, 120, 80)
  220. down.Position = UDim2.new(0.58, 0, 0.68, 0)
  221. down.Size = UDim2.new(0, 88, 0, 42)
  222. down.Font = Enum.Font.GothamBold
  223. down.Text = "↓ DOWN"
  224. down.TextColor3 = Color3.fromRGB(0, 0, 0)
  225. down.TextSize = 17
  226.  
  227. local downCorner = Instance.new("UICorner")
  228. downCorner.CornerRadius = UDim.new(0, 12)
  229. downCorner.Parent = down
  230.  
  231. -- ==================== NOTIFICATION ====================
  232. StarterGui:SetCore(
  233. "SendNotification",
  234. {
  235. Title = "FLY GUI V3",
  236. Text = "Modern Edition Loaded ✓\nMade with ❤️ by Grok",
  237. Icon = "rbxthumb://type=Asset&id=5107182114&w=150&h=150",
  238. Duration = 6
  239. }
  240. )
  241.  
  242. -- ==================== SAME VARIABLES & LOGIC ====================
  243. local speeds = 1
  244. local nowe = false
  245. local tpwalking = false
  246. local speaker = player
  247.  
  248. local function updateSpeedLabel()
  249. speed.Text = tostring(speeds)
  250. end
  251.  
  252. -- ==================== UNIVERSAL DRAG (PC + MOBILE) ====================
  253. local function makeDraggable(frameToDrag)
  254. local dragging = false
  255. local dragInput
  256. local dragStart
  257. local startPos
  258.  
  259. local function update(input)
  260. local delta = input.Position - dragStart
  261. frameToDrag.Position =
  262. UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  263. end
  264.  
  265. frameToDrag.InputBegan:Connect(
  266. function(input)
  267. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  268. dragging = true
  269. dragStart = input.Position
  270. startPos = frameToDrag.Position
  271.  
  272. input.Changed:Connect(
  273. function()
  274. if input.UserInputState == Enum.UserInputState.End then
  275. dragging = false
  276. end
  277. end
  278. )
  279. end
  280. end
  281. )
  282.  
  283. frameToDrag.InputChanged:Connect(
  284. function(input)
  285. if
  286. input.UserInputType == Enum.UserInputType.MouseMovement or
  287. input.UserInputType == Enum.UserInputType.Touch
  288. then
  289. dragInput = input
  290. end
  291. end
  292. )
  293.  
  294. UserInputService.InputChanged:Connect(
  295. function(input)
  296. if input == dragInput and dragging then
  297. update(input)
  298. end
  299. end
  300. )
  301. end
  302.  
  303. makeDraggable(titleBar) -- Drag only from title bar (feels premium)
  304.  
  305. -- ==================== BUTTON ANIMATIONS (Tween) ====================
  306. local function buttonPress(btn)
  307. local goal = {
  308. Size = UDim2.new(
  309. btn.Size.X.Scale * 0.92,
  310. btn.Size.X.Offset * 0.92,
  311. btn.Size.Y.Scale * 0.92,
  312. btn.Size.Y.Offset * 0.92
  313. )
  314. }
  315. TweenService:Create(btn, TweenInfo.new(0.1, Enum.EasingStyle.Quad), goal):Play()
  316. task.delay(
  317. 0.1,
  318. function()
  319. TweenService:Create(btn, TweenInfo.new(0.15, Enum.EasingStyle.Quad), {Size = btn.Size}):Play()
  320. end
  321. )
  322. end
  323.  
  324. -- ==================== MINIMIZE / MAXIMIZE ANIMATION ====================
  325. local originalSize = mainFrame.Size
  326. local minimized = false
  327.  
  328. local function minimizeGui()
  329. minimized = true
  330. TweenService:Create(
  331. mainFrame,
  332. TweenInfo.new(0.35, Enum.EasingStyle.Quint, Enum.EasingDirection.Out),
  333. {Size = UDim2.new(0, 250, 0, 38)}
  334. ):Play()
  335. task.delay(
  336. 0.2,
  337. function()
  338. content.Visible = false
  339. miniButton.Visible = false
  340. mini2Button.Visible = true
  341. end
  342. )
  343. end
  344.  
  345. local function maximizeGui()
  346. minimized = false
  347. content.Visible = true
  348. miniButton.Visible = true
  349. mini2Button.Visible = false
  350. TweenService:Create(
  351. mainFrame,
  352. TweenInfo.new(0.35, Enum.EasingStyle.Quint, Enum.EasingDirection.Out),
  353. {Size = originalSize}
  354. ):Play()
  355. end
  356.  
  357. -- ==================== SAME FLY LOGIC (EXACTLY YOUR ORIGINAL CODE) ====================
  358. local tis, dis
  359.  
  360. onof.MouseButton1Click:Connect(
  361. function()
  362. buttonPress(onof)
  363.  
  364. if nowe == true then
  365. nowe = false
  366. onof.Text = "FLY OFF"
  367. onof.BackgroundColor3 = Color3.fromRGB(255, 70, 70)
  368.  
  369. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, true)
  370. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, true)
  371. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Flying, true)
  372. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall, true)
  373. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
  374. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
  375. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Landed, true)
  376. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics, true)
  377. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding, true)
  378. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, true)
  379. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Running, true)
  380. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.RunningNoPhysics, true)
  381. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, true)
  382. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.StrafingNoPhysics, true)
  383. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, true)
  384. speaker.Character.Humanoid:ChangeState(Enum.HumanoidStateType.RunningNoPhysics)
  385.  
  386. tpwalking = false
  387. else
  388. nowe = true
  389. onof.Text = "FLY ON"
  390. onof.BackgroundColor3 = Color3.fromRGB(80, 255, 80)
  391.  
  392. for i = 1, speeds do
  393. spawn(
  394. function()
  395. local hb = RunService.Heartbeat
  396. tpwalking = true
  397. local chr = player.Character
  398. local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  399. while tpwalking and hb:Wait() and chr and hum and hum.Parent do
  400. if hum.MoveDirection.Magnitude > 0 then
  401. chr:TranslateBy(hum.MoveDirection)
  402. end
  403. end
  404. end
  405. )
  406. end
  407.  
  408. player.Character.Animate.Disabled = true
  409. local Char = player.Character
  410. local Hum = Char:FindFirstChildOfClass("Humanoid") or Char:FindFirstChildOfClass("AnimationController")
  411. for i, v in next, Hum:GetPlayingAnimationTracks() do
  412. v:AdjustSpeed(0)
  413. end
  414.  
  415. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
  416. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
  417. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Flying, false)
  418. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall, false)
  419. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
  420. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
  421. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Landed, false)
  422. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics, false)
  423. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding, false)
  424. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
  425. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Running, false)
  426. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.RunningNoPhysics, false)
  427. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false)
  428. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.StrafingNoPhysics, false)
  429. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)
  430. speaker.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Swimming)
  431.  
  432. -- R6 / R15 flying code (EXACTLY your original)
  433. if player.Character:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R6 then
  434. local plr = player
  435. local torso = plr.Character.Torso
  436. local bg = Instance.new("BodyGyro", torso)
  437. bg.P = 9e4
  438. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  439. bg.cframe = torso.CFrame
  440. local bv = Instance.new("BodyVelocity", torso)
  441. bv.velocity = Vector3.new(0, 0.1, 0)
  442. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  443. plr.Character.Humanoid.PlatformStand = true
  444.  
  445. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  446. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  447. local maxspeed = 50
  448. local speed = 0
  449.  
  450. while nowe == true or plr.Character.Humanoid.Health == 0 do
  451. RunService.RenderStepped:Wait()
  452. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  453. speed = speed + .5 + (speed / maxspeed)
  454. if speed > maxspeed then
  455. speed = maxspeed
  456. end
  457. elseif speed ~= 0 then
  458. speed = speed - 1
  459. if speed < 0 then
  460. speed = 0
  461. end
  462. end
  463. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  464. bv.velocity =
  465. ((workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f + ctrl.b)) +
  466. ((workspace.CurrentCamera.CoordinateFrame *
  467. CFrame.new(ctrl.l + ctrl.r, (ctrl.f + ctrl.b) * .2, 0).p) -
  468. workspace.CurrentCamera.CoordinateFrame.p)) *
  469. speed
  470. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  471. elseif speed ~= 0 then
  472. bv.velocity =
  473. ((workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f + lastctrl.b)) +
  474. ((workspace.CurrentCamera.CoordinateFrame *
  475. CFrame.new(lastctrl.l + lastctrl.r, (lastctrl.f + lastctrl.b) * .2, 0).p) -
  476. workspace.CurrentCamera.CoordinateFrame.p)) *
  477. speed
  478. else
  479. bv.velocity = Vector3.new(0, 0, 0)
  480. end
  481. bg.cframe =
  482. workspace.CurrentCamera.CoordinateFrame *
  483. CFrame.Angles(-math.rad((ctrl.f + ctrl.b) * 50 * speed / maxspeed), 0, 0)
  484. end
  485. bg:Destroy()
  486. bv:Destroy()
  487. plr.Character.Humanoid.PlatformStand = false
  488. tpwalking = false
  489. else
  490. -- R15 part (identical to your original)
  491. local plr = player
  492. local UpperTorso = plr.Character.UpperTorso
  493. local bg = Instance.new("BodyGyro", UpperTorso)
  494. bg.P = 9e4
  495. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  496. bg.cframe = UpperTorso.CFrame
  497. local bv = Instance.new("BodyVelocity", UpperTorso)
  498. bv.velocity = Vector3.new(0, 0.1, 0)
  499. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  500. plr.Character.Humanoid.PlatformStand = true
  501.  
  502. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  503. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  504. local maxspeed = 50
  505. local speed = 0
  506.  
  507. while nowe == true or plr.Character.Humanoid.Health == 0 do
  508. wait()
  509. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  510. speed = speed + .5 + (speed / maxspeed)
  511. if speed > maxspeed then
  512. speed = maxspeed
  513. end
  514. elseif speed ~= 0 then
  515. speed = speed - 1
  516. if speed < 0 then
  517. speed = 0
  518. end
  519. end
  520. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  521. bv.velocity =
  522. ((workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f + ctrl.b)) +
  523. ((workspace.CurrentCamera.CoordinateFrame *
  524. CFrame.new(ctrl.l + ctrl.r, (ctrl.f + ctrl.b) * .2, 0).p) -
  525. workspace.CurrentCamera.CoordinateFrame.p)) *
  526. speed
  527. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  528. elseif speed ~= 0 then
  529. bv.velocity =
  530. ((workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f + lastctrl.b)) +
  531. ((workspace.CurrentCamera.CoordinateFrame *
  532. CFrame.new(lastctrl.l + lastctrl.r, (lastctrl.f + lastctrl.b) * .2, 0).p) -
  533. workspace.CurrentCamera.CoordinateFrame.p)) *
  534. speed
  535. else
  536. bv.velocity = Vector3.new(0, 0, 0)
  537. end
  538. bg.cframe =
  539. workspace.CurrentCamera.CoordinateFrame *
  540. CFrame.Angles(-math.rad((ctrl.f + ctrl.b) * 50 * speed / maxspeed), 0, 0)
  541. end
  542. bg:Destroy()
  543. bv:Destroy()
  544. plr.Character.Humanoid.PlatformStand = false
  545. tpwalking = false
  546. end
  547. end
  548. end
  549. )
  550.  
  551. -- UP / DOWN hold movement (exactly your original logic)
  552. up.MouseButton1Down:Connect(
  553. function()
  554. buttonPress(up)
  555. tis =
  556. up.MouseEnter:Connect(
  557. function()
  558. while tis do
  559. RunService.Heartbeat:Wait()
  560. if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  561. player.Character.HumanoidRootPart.CFrame =
  562. player.Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, 0)
  563. end
  564. end
  565. end
  566. )
  567. end
  568. )
  569.  
  570. up.MouseLeave:Connect(
  571. function()
  572. if tis then
  573. tis:Disconnect()
  574. tis = nil
  575. end
  576. end
  577. )
  578.  
  579. down.MouseButton1Down:Connect(
  580. function()
  581. buttonPress(down)
  582. dis =
  583. down.MouseEnter:Connect(
  584. function()
  585. while dis do
  586. RunService.Heartbeat:Wait()
  587. if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  588. player.Character.HumanoidRootPart.CFrame =
  589. player.Character.HumanoidRootPart.CFrame * CFrame.new(0, -1, 0)
  590. end
  591. end
  592. end
  593. )
  594. end
  595. )
  596.  
  597. down.MouseLeave:Connect(
  598. function()
  599. if dis then
  600. dis:Disconnect()
  601. dis = nil
  602. end
  603. end
  604. )
  605.  
  606. -- Speed + / -
  607. plus.MouseButton1Click:Connect(
  608. function()
  609. buttonPress(plus)
  610. speeds = speeds + 1
  611. updateSpeedLabel()
  612.  
  613. if nowe then
  614. tpwalking = false
  615. for i = 1, speeds do
  616. spawn(
  617. function()
  618. local hb = RunService.Heartbeat
  619. tpwalking = true
  620. local chr = player.Character
  621. local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  622. while tpwalking and hb:Wait() and chr and hum and hum.Parent do
  623. if hum.MoveDirection.Magnitude > 0 then
  624. chr:TranslateBy(hum.MoveDirection)
  625. end
  626. end
  627. end
  628. )
  629. end
  630. end
  631. end
  632. )
  633.  
  634. mine.MouseButton1Click:Connect(
  635. function()
  636. buttonPress(mine)
  637. if speeds == 1 then
  638. speed.Text = "MIN"
  639. task.delay(
  640. 0.8,
  641. function()
  642. updateSpeedLabel()
  643. end
  644. )
  645. else
  646. speeds = speeds - 1
  647. updateSpeedLabel()
  648.  
  649. if nowe then
  650. tpwalking = false
  651. for i = 1, speeds do
  652. spawn(
  653. function()
  654. local hb = RunService.Heartbeat
  655. tpwalking = true
  656. local chr = player.Character
  657. local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  658. while tpwalking and hb:Wait() and chr and hum and hum.Parent do
  659. if hum.MoveDirection.Magnitude > 0 then
  660. chr:TranslateBy(hum.MoveDirection)
  661. end
  662. end
  663. end
  664. )
  665. end
  666. end
  667. end
  668. end
  669. )
  670.  
  671. -- Close & Minimize
  672. closeButton.MouseButton1Click:Connect(
  673. function()
  674. buttonPress(closeButton)
  675. screenGui:Destroy()
  676. end
  677. )
  678.  
  679. miniButton.MouseButton1Click:Connect(
  680. function()
  681. buttonPress(miniButton)
  682. minimizeGui()
  683. end
  684. )
  685.  
  686. mini2Button.MouseButton1Click:Connect(
  687. function()
  688. buttonPress(mini2Button)
  689. maximizeGui()
  690. end
  691. )
  692.  
  693. -- Respawn fix
  694. player.CharacterAdded:Connect(
  695. function()
  696. task.wait(0.7)
  697. if player.Character and player.Character:FindFirstChild("Humanoid") then
  698. player.Character.Humanoid.PlatformStand = false
  699. player.Character.Animate.Disabled = false
  700. end
  701. end
  702. )
  703.  
Advertisement
Add Comment
Please, Sign In to add comment