Advertisement
kill21_2

farm BT

Apr 26th, 2025
969
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.33 KB | None | 0 0
  1. local player = game:GetService("Players").LocalPlayer
  2. local waypoints = {
  3. Vector3.new(-67.89, 109.88, -291.54),
  4. Vector3.new(-34.25, 113.01, 1015.99),
  5. Vector3.new(-59.15, 60.35, 1755.57),
  6. Vector3.new(-58.76, 54.83, 2559.51),
  7. Vector3.new(-49.40, 49.37, 3279.51),
  8. Vector3.new(-39.11, 43.36, 4071.51),
  9. Vector3.new(-52.92, 76.73, 4917.92),
  10. Vector3.new(-64.34, 46.81, 5600.81),
  11. Vector3.new(-65.79, 58.46, 6284.62),
  12. Vector3.new(-58.31, 70.29, 7015.42),
  13. Vector3.new(-64.28, 40.29, 7734.50),
  14. Vector3.new(-74.22, 48.38, 8658.49),
  15. Vector3.new(-22.66, -249.61, 8733.02),
  16. Vector3.new(-41.25, -333.82, 9347.80)
  17. }
  18.  
  19. local scriptActive = true
  20. local debounce = false
  21. local screenGui = nil
  22. local bodyVelocity = nil
  23. local flyingCoroutine = nil
  24.  
  25. -- Переменные для счетчиков
  26. local startTime = os.time()
  27. local totalEarned = 0
  28. local flightsCompleted = 0
  29. local goldPerFlight = 80
  30.  
  31. -- Функция для форматирования времени
  32. local function formatTime(seconds)
  33. local hours = math.floor(seconds / 3600)
  34. local minutes = math.floor((seconds % 3600) / 60)
  35. local seconds = seconds % 60
  36. return string.format("%02d:%02d:%02d", hours, minutes, seconds)
  37. end
  38.  
  39. -- Функция для создания красивого GUI
  40. local function createFlightGUI()
  41. if player.PlayerGui:FindFirstChild("FlightGUI") then
  42. player.PlayerGui.FlightGUI:Destroy()
  43. end
  44.  
  45. screenGui = Instance.new("ScreenGui")
  46. screenGui.Name = "FlightGUI"
  47. screenGui.ResetOnSpawn = false
  48. screenGui.Parent = player.PlayerGui
  49.  
  50. local mainFrame = Instance.new("Frame")
  51. mainFrame.Name = "MainFrame"
  52. mainFrame.Size = UDim2.new(0, 250, 0, 160)
  53. mainFrame.Position = UDim2.new(0.5, -125, 0, 20)
  54. mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
  55. mainFrame.BackgroundTransparency = 0.2
  56. mainFrame.BorderSizePixel = 0
  57. mainFrame.Parent = screenGui
  58.  
  59. local corner = Instance.new("UICorner")
  60. corner.CornerRadius = UDim.new(0, 8)
  61. corner.Parent = mainFrame
  62.  
  63. local shadow = Instance.new("ImageLabel")
  64. shadow.Name = "Shadow"
  65. shadow.Size = UDim2.new(1, 10, 1, 10)
  66. shadow.Position = UDim2.new(0, -5, 0, -5)
  67. shadow.Image = "rbxassetid://1316045217"
  68. shadow.ImageColor3 = Color3.new(0, 0, 0)
  69. shadow.ImageTransparency = 0.8
  70. shadow.ScaleType = Enum.ScaleType.Slice
  71. shadow.SliceCenter = Rect.new(10, 10, 118, 118)
  72. shadow.BackgroundTransparency = 1
  73. shadow.ZIndex = -1
  74. shadow.Parent = mainFrame
  75.  
  76. local title = Instance.new("TextLabel")
  77. title.Name = "Title"
  78. title.Size = UDim2.new(1, 0, 0, 30)
  79. title.Position = UDim2.new(0, 0, 0, 0)
  80. title.Text = "Автофарм"
  81. title.TextColor3 = Color3.fromRGB(255, 255, 255)
  82. title.BackgroundTransparency = 1
  83. title.Font = Enum.Font.GothamBold
  84. title.TextSize = 18
  85. title.Parent = mainFrame
  86.  
  87. -- Счетчик времени
  88. local timeLabel = Instance.new("TextLabel")
  89. timeLabel.Name = "TimeLabel"
  90. timeLabel.Size = UDim2.new(1, -10, 0, 20)
  91. timeLabel.Position = UDim2.new(0, 5, 0, 35)
  92. timeLabel.Text = "Время: 00:00:00"
  93. timeLabel.TextColor3 = Color3.fromRGB(200, 200, 255)
  94. timeLabel.BackgroundTransparency = 1
  95. timeLabel.Font = Enum.Font.Gotham
  96. timeLabel.TextSize = 14
  97. timeLabel.TextXAlignment = Enum.TextXAlignment.Left
  98. timeLabel.Parent = mainFrame
  99.  
  100. -- Счетчик заработанного золота
  101. local goldLabel = Instance.new("TextLabel")
  102. goldLabel.Name = "GoldLabel"
  103. goldLabel.Size = UDim2.new(1, -10, 0, 20)
  104. goldLabel.Position = UDim2.new(0, 5, 0, 55)
  105. goldLabel.Text = "Заработано: 0 золота"
  106. goldLabel.TextColor3 = Color3.fromRGB(255, 215, 0)
  107. goldLabel.BackgroundTransparency = 1
  108. goldLabel.Font = Enum.Font.Gotham
  109. goldLabel.TextSize = 14
  110. goldLabel.TextXAlignment = Enum.TextXAlignment.Left
  111. goldLabel.Parent = mainFrame
  112.  
  113. -- Счетчик полетов
  114. local flightsLabel = Instance.new("TextLabel")
  115. flightsLabel.Name = "FlightsLabel"
  116. flightsLabel.Size = UDim2.new(1, -10, 0, 20)
  117. flightsLabel.Position = UDim2.new(0, 5, 0, 75)
  118. flightsLabel.Text = "Полетов: 0"
  119. flightsLabel.TextColor3 = Color3.fromRGB(200, 255, 200)
  120. flightsLabel.BackgroundTransparency = 1
  121. flightsLabel.Font = Enum.Font.Gotham
  122. flightsLabel.TextSize = 14
  123. flightsLabel.TextXAlignment = Enum.TextXAlignment.Left
  124. flightsLabel.Parent = mainFrame
  125.  
  126. local toggleButton = Instance.new("TextButton")
  127. toggleButton.Name = "ToggleButton"
  128. toggleButton.Size = UDim2.new(0.9, 0, 0, 40)
  129. toggleButton.Position = UDim2.new(0.05, 0, 0, 100)
  130. toggleButton.Text = "ОСТАНОВИТЬ"
  131. toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  132. toggleButton.Font = Enum.Font.GothamBold
  133. toggleButton.TextSize = 14
  134. toggleButton.AutoButtonColor = false
  135. toggleButton.Parent = mainFrame
  136.  
  137. local buttonCorner = Instance.new("UICorner")
  138. buttonCorner.CornerRadius = UDim.new(0, 6)
  139. buttonCorner.Parent = toggleButton
  140.  
  141. local buttonGradient = Instance.new("UIGradient")
  142. buttonGradient.Color = ColorSequence.new({
  143. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 60, 60)),
  144. ColorSequenceKeypoint.new(1, Color3.fromRGB(180, 20, 20))
  145. })
  146. buttonGradient.Rotation = 90
  147. buttonGradient.Parent = toggleButton
  148.  
  149. toggleButton.MouseEnter:Connect(function()
  150. game:GetService("TweenService"):Create(
  151. toggleButton,
  152. TweenInfo.new(0.2),
  153. {TextColor3 = Color3.fromRGB(230, 230, 230)}
  154. ):Play()
  155. end)
  156.  
  157. toggleButton.MouseLeave:Connect(function()
  158. game:GetService("TweenService"):Create(
  159. toggleButton,
  160. TweenInfo.new(0.2),
  161. {TextColor3 = Color3.fromRGB(255, 255, 255)}
  162. ):Play()
  163. end)
  164.  
  165. toggleButton.MouseButton1Click:Connect(function()
  166. scriptActive = not scriptActive
  167. if scriptActive then
  168. toggleButton.Text = "ОСТАНОВИТЬ"
  169. buttonGradient.Color = ColorSequence.new({
  170. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 60, 60)),
  171. ColorSequenceKeypoint.new(1, Color3.fromRGB(180, 20, 20))
  172. })
  173. -- При повторном включении скрипта
  174. local character = player.Character
  175. if character then
  176. setupZeroGravity(character)
  177. startFlying(character)
  178. end
  179. else
  180. toggleButton.Text = "ЗАПУСТИТЬ"
  181. buttonGradient.Color = ColorSequence.new({
  182. ColorSequenceKeypoint.new(0, Color3.fromRGB(60, 255, 60)),
  183. ColorSequenceKeypoint.new(1, Color3.fromRGB(20, 180, 20))
  184. })
  185. -- Отключаем физику при выключении
  186. if bodyVelocity then
  187. bodyVelocity:Destroy()
  188. bodyVelocity = nil
  189. end
  190. -- Останавливаем корутину полета
  191. if flyingCoroutine then
  192. coroutine.close(flyingCoroutine)
  193. flyingCoroutine = nil
  194. end
  195. end
  196. end)
  197.  
  198. -- Функция для обновления счетчиков
  199. local function updateCounters()
  200. while true do
  201. local elapsedTime = os.time() - startTime
  202. timeLabel.Text = "Время: " .. formatTime(elapsedTime)
  203. goldLabel.Text = "Заработано: " .. totalEarned .. " золота"
  204. flightsLabel.Text = "Полетов: " .. flightsCompleted
  205.  
  206. wait(1)
  207. end
  208. end
  209.  
  210. -- Запускаем обновление счетчиков
  211. coroutine.wrap(updateCounters)()
  212. end
  213.  
  214. -- Функция для установки нулевой гравитации
  215. local function setupZeroGravity(character)
  216. if not character then return end
  217.  
  218. local humanoid = character:FindFirstChildOfClass("Humanoid")
  219. local rootPart = character:FindFirstChild("HumanoidRootPart")
  220.  
  221. if not humanoid or not rootPart then return end
  222.  
  223. -- Удаляем старый BodyVelocity если есть
  224. if bodyVelocity then
  225. bodyVelocity:Destroy()
  226. bodyVelocity = nil
  227. end
  228.  
  229. -- Создаем новый BodyVelocity для контроля полета
  230. bodyVelocity = Instance.new("BodyVelocity")
  231. bodyVelocity.Velocity = Vector3.new(0, 0, 0)
  232. bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  233. bodyVelocity.P = 10000
  234. bodyVelocity.Parent = rootPart
  235.  
  236. -- Отключаем гравитацию
  237. local bodyGyro = Instance.new("BodyGyro")
  238. bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  239. bodyGyro.P = 10000
  240. bodyGyro.D = 500
  241. bodyGyro.Parent = rootPart
  242.  
  243. -- Устанавливаем состояние полета
  244. humanoid:ChangeState(Enum.HumanoidStateType.Flying)
  245. end
  246.  
  247. -- Функция для телепортации к точке
  248. local function teleportToWaypoint(character, point)
  249. if not scriptActive then return end
  250. if not character or not character:FindFirstChild("HumanoidRootPart") then return end
  251.  
  252. local rootPart = character.HumanoidRootPart
  253. setupZeroGravity(character)
  254.  
  255. local tweenInfo = TweenInfo.new(
  256. 1,
  257. Enum.EasingStyle.Quad,
  258. Enum.EasingDirection.InOut,
  259. 0,
  260. false,
  261. 0
  262. )
  263.  
  264. local tween = game:GetService("TweenService"):Create(
  265. rootPart,
  266. tweenInfo,
  267. {CFrame = CFrame.new(point)}
  268. )
  269. tween:Play()
  270. tween.Completed:Wait()
  271.  
  272. -- Фиксируем позицию после твина
  273. if bodyVelocity then
  274. bodyVelocity.Velocity = Vector3.new(0, 0, 0)
  275. end
  276. end
  277.  
  278. -- Основная функция полета
  279. local function flyThroughWaypoints(character)
  280. while scriptActive do
  281. for _, waypoint in ipairs(waypoints) do
  282. if not scriptActive then break end
  283. teleportToWaypoint(character, waypoint)
  284. wait(0.5)
  285. end
  286.  
  287. if scriptActive and character then
  288. -- Увеличиваем счетчики после завершения полета
  289. flightsCompleted = flightsCompleted + 1
  290. totalEarned = totalEarned + goldPerFlight
  291.  
  292. local humanoid = character:FindFirstChildOfClass("Humanoid")
  293. if humanoid then
  294. -- Удаляем физику перед смертью
  295. if bodyVelocity then
  296. bodyVelocity:Destroy()
  297. bodyVelocity = nil
  298. end
  299.  
  300. humanoid.Health = 0
  301. wait(4)
  302.  
  303. -- Ждем возрождения
  304. character = player.Character or player.CharacterAdded:Wait()
  305. wait(1)
  306. -- После ресета снова включаем нулевую гравитацию
  307. if scriptActive then
  308. setupZeroGravity(character)
  309. end
  310. end
  311. end
  312. end
  313. end
  314.  
  315. -- Функция для запуска полета в корутине
  316. local function startFlying(character)
  317. if flyingCoroutine then
  318. coroutine.close(flyingCoroutine)
  319. end
  320. flyingCoroutine = coroutine.create(function()
  321. flyThroughWaypoints(character)
  322. end)
  323. coroutine.resume(flyingCoroutine)
  324. end
  325.  
  326. -- Создаем GUI
  327. createFlightGUI()
  328.  
  329. -- Обработчик изменения персонажа
  330. player.CharacterAdded:Connect(function(character)
  331. if scriptActive and not debounce then
  332. debounce = true
  333. wait(4) -- Даем время на полное появление персонажа
  334. debounce = false
  335. -- При появлении нового персонажа включаем нулевую гравитацию
  336. setupZeroGravity(character)
  337. startFlying(character)
  338. end
  339. end)
  340.  
  341. -- Начальный запуск
  342. local character = player.Character or player.CharacterAdded:Wait()
  343. setupZeroGravity(character)
  344. startFlying(character)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement