Advertisement
kill21_2

farm BT for rscripts

May 2nd, 2025
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.07 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 currentLanguage = "russian" -- По умолчанию русский
  33. local translations = {
  34. russian = {
  35. title = "Автофарм",
  36. time = "Время: ",
  37. earned = "Заработано: ",
  38. gold = " золота",
  39. flights = "Полетов: ",
  40. stop = "ОСТАНОВИТЬ",
  41. start = "ЗАПУСТИТЬ",
  42. language = "Язык: EN"
  43. },
  44. english = {
  45. title = "Autofarm",
  46. time = "Time: ",
  47. earned = "Earned: ",
  48. gold = " gold",
  49. flights = "Flights: ",
  50. stop = "STOP",
  51. start = "START",
  52. language = "Язык: RU"
  53. }
  54. }
  55.  
  56. -- Функция для форматирования времени
  57. local function formatTime(seconds)
  58. local hours = math.floor(seconds / 3600)
  59. local minutes = math.floor((seconds % 3600) / 60)
  60. local seconds = seconds % 60
  61. return string.format("%02d:%02d:%02d", hours, minutes, seconds)
  62. end
  63.  
  64. -- Функция для обновления текста в GUI
  65. local function updateGUIText()
  66. if not screenGui then return end
  67.  
  68. local lang = translations[currentLanguage]
  69. local mainFrame = screenGui:FindFirstChild("MainFrame")
  70. if not mainFrame then return end
  71.  
  72. mainFrame.Title.Text = lang.title
  73. mainFrame.TimeLabel.Text = lang.time .. formatTime(os.time() - startTime)
  74. mainFrame.GoldLabel.Text = lang.earned .. totalEarned .. lang.gold
  75. mainFrame.FlightsLabel.Text = lang.flights .. flightsCompleted
  76.  
  77. local toggleButton = mainFrame:FindFirstChild("ToggleButton")
  78. if toggleButton then
  79. toggleButton.Text = scriptActive and lang.stop or lang.start
  80. end
  81.  
  82. local languageButton = mainFrame:FindFirstChild("LanguageButton")
  83. if languageButton then
  84. languageButton.Text = lang.language
  85. end
  86. end
  87.  
  88. -- Функция для создания красивого GUI
  89. local function createFlightGUI()
  90. if player.PlayerGui:FindFirstChild("FlightGUI") then
  91. player.PlayerGui.FlightGUI:Destroy()
  92. end
  93.  
  94. screenGui = Instance.new("ScreenGui")
  95. screenGui.Name = "FlightGUI"
  96. screenGui.ResetOnSpawn = false
  97. screenGui.Parent = player.PlayerGui
  98.  
  99. local mainFrame = Instance.new("Frame")
  100. mainFrame.Name = "MainFrame"
  101. mainFrame.Size = UDim2.new(0, 250, 0, 210) -- Увеличили высоту для новой кнопки
  102. mainFrame.Position = UDim2.new(0.5, -125, 0, 20)
  103. mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
  104. mainFrame.BackgroundTransparency = 0.2
  105. mainFrame.BorderSizePixel = 0
  106. mainFrame.Parent = screenGui
  107.  
  108. local corner = Instance.new("UICorner")
  109. corner.CornerRadius = UDim.new(0, 8)
  110. corner.Parent = mainFrame
  111.  
  112. local shadow = Instance.new("ImageLabel")
  113. shadow.Name = "Shadow"
  114. shadow.Size = UDim2.new(1, 10, 1, 10)
  115. shadow.Position = UDim2.new(0, -5, 0, -5)
  116. shadow.Image = "rbxassetid://1316045217"
  117. shadow.ImageColor3 = Color3.new(0, 0, 0)
  118. shadow.ImageTransparency = 0.8
  119. shadow.ScaleType = Enum.ScaleType.Slice
  120. shadow.SliceCenter = Rect.new(10, 10, 118, 118)
  121. shadow.BackgroundTransparency = 1
  122. shadow.ZIndex = -1
  123. shadow.Parent = mainFrame
  124.  
  125. local title = Instance.new("TextLabel")
  126. title.Name = "Title"
  127. title.Size = UDim2.new(1, 0, 0, 30)
  128. title.Position = UDim2.new(0, 0, 0, 0)
  129. title.Text = "Автофарм"
  130. title.TextColor3 = Color3.fromRGB(255, 255, 255)
  131. title.BackgroundTransparency = 1
  132. title.Font = Enum.Font.GothamBold
  133. title.TextSize = 18
  134. title.Parent = mainFrame
  135.  
  136. -- Счетчик времени
  137. local timeLabel = Instance.new("TextLabel")
  138. timeLabel.Name = "TimeLabel"
  139. timeLabel.Size = UDim2.new(1, -10, 0, 20)
  140. timeLabel.Position = UDim2.new(0, 5, 0, 35)
  141. timeLabel.Text = "Время: 00:00:00"
  142. timeLabel.TextColor3 = Color3.fromRGB(200, 200, 255)
  143. timeLabel.BackgroundTransparency = 1
  144. timeLabel.Font = Enum.Font.Gotham
  145. timeLabel.TextSize = 14
  146. timeLabel.TextXAlignment = Enum.TextXAlignment.Left
  147. timeLabel.Parent = mainFrame
  148.  
  149. -- Счетчик заработанного золота
  150. local goldLabel = Instance.new("TextLabel")
  151. goldLabel.Name = "GoldLabel"
  152. goldLabel.Size = UDim2.new(1, -10, 0, 20)
  153. goldLabel.Position = UDim2.new(0, 5, 0, 55)
  154. goldLabel.Text = "Заработано: 0 золота"
  155. goldLabel.TextColor3 = Color3.fromRGB(255, 215, 0)
  156. goldLabel.BackgroundTransparency = 1
  157. goldLabel.Font = Enum.Font.Gotham
  158. goldLabel.TextSize = 14
  159. goldLabel.TextXAlignment = Enum.TextXAlignment.Left
  160. goldLabel.Parent = mainFrame
  161.  
  162. -- Счетчик полетов
  163. local flightsLabel = Instance.new("TextLabel")
  164. flightsLabel.Name = "FlightsLabel"
  165. flightsLabel.Size = UDim2.new(1, -10, 0, 20)
  166. flightsLabel.Position = UDim2.new(0, 5, 0, 75)
  167. flightsLabel.Text = "Полетов: 0"
  168. flightsLabel.TextColor3 = Color3.fromRGB(200, 255, 200)
  169. flightsLabel.BackgroundTransparency = 1
  170. flightsLabel.Font = Enum.Font.Gotham
  171. flightsLabel.TextSize = 14
  172. flightsLabel.TextXAlignment = Enum.TextXAlignment.Left
  173. flightsLabel.Parent = mainFrame
  174.  
  175. -- (Предыдущий код остается без изменений до создания languageButton)
  176.  
  177. -- Кнопка переключения языка
  178. local languageButton = Instance.new("TextButton")
  179. languageButton.Name = "LanguageButton"
  180. languageButton.Size = UDim2.new(0.9, 0, 0, 30)
  181. languageButton.Position = UDim2.new(0.05, 0, 0, 100)
  182. languageButton.Text = "Язык: EN"
  183. languageButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  184. languageButton.Font = Enum.Font.Gotham
  185. languageButton.TextSize = 14
  186. languageButton.AutoButtonColor = false
  187. languageButton.Parent = mainFrame
  188.  
  189. local langButtonCorner = Instance.new("UICorner")
  190. langButtonCorner.CornerRadius = UDim.new(0, 6)
  191. langButtonCorner.Parent = languageButton
  192.  
  193. -- Изменяем градиент на розовый
  194. local langButtonGradient = Instance.new("UIGradient")
  195. langButtonGradient.Color = ColorSequence.new({
  196. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 105, 180)), -- Ярко-розовый
  197. ColorSequenceKeypoint.new(1, Color3.fromRGB(220, 70, 150)) -- Темно-розовый
  198. })
  199. langButtonGradient.Rotation = 90
  200. langButtonGradient.Parent = languageButton
  201.  
  202. languageButton.MouseEnter:Connect(function()
  203. game:GetService("TweenService"):Create(
  204. languageButton,
  205. TweenInfo.new(0.2),
  206. {TextColor3 = Color3.fromRGB(230, 230, 230)}
  207. ):Play()
  208. end)
  209.  
  210. languageButton.MouseLeave:Connect(function()
  211. game:GetService("TweenService"):Create(
  212. languageButton,
  213. TweenInfo.new(0.2),
  214. {TextColor3 = Color3.fromRGB(255, 255, 255)}
  215. ):Play()
  216. end)
  217.  
  218. -- (Остальной код остается без изменений)
  219.  
  220. languageButton.MouseButton1Click:Connect(function()
  221. -- Переключаем язык
  222. currentLanguage = (currentLanguage == "russian") and "english" or "russian"
  223. updateGUIText()
  224. end)
  225.  
  226. local toggleButton = Instance.new("TextButton")
  227. toggleButton.Name = "ToggleButton"
  228. toggleButton.Size = UDim2.new(0.9, 0, 0, 40)
  229. toggleButton.Position = UDim2.new(0.05, 0, 0, 140)
  230. toggleButton.Text = "ОСТАНОВИТЬ"
  231. toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  232. toggleButton.Font = Enum.Font.GothamBold
  233. toggleButton.TextSize = 14
  234. toggleButton.AutoButtonColor = false
  235. toggleButton.Parent = mainFrame
  236.  
  237. local buttonCorner = Instance.new("UICorner")
  238. buttonCorner.CornerRadius = UDim.new(0, 6)
  239. buttonCorner.Parent = toggleButton
  240.  
  241. local buttonGradient = Instance.new("UIGradient")
  242. buttonGradient.Color = ColorSequence.new({
  243. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 60, 60)),
  244. ColorSequenceKeypoint.new(1, Color3.fromRGB(180, 20, 20))
  245. })
  246. buttonGradient.Rotation = 90
  247. buttonGradient.Parent = toggleButton
  248.  
  249. toggleButton.MouseEnter:Connect(function()
  250. game:GetService("TweenService"):Create(
  251. toggleButton,
  252. TweenInfo.new(0.2),
  253. {TextColor3 = Color3.fromRGB(230, 230, 230)}
  254. ):Play()
  255. end)
  256.  
  257. toggleButton.MouseLeave:Connect(function()
  258. game:GetService("TweenService"):Create(
  259. toggleButton,
  260. TweenInfo.new(0.2),
  261. {TextColor3 = Color3.fromRGB(255, 255, 255)}
  262. ):Play()
  263. end)
  264.  
  265. toggleButton.MouseButton1Click:Connect(function()
  266. scriptActive = not scriptActive
  267. if scriptActive then
  268. toggleButton.Text = translations[currentLanguage].stop
  269. buttonGradient.Color = ColorSequence.new({
  270. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 60, 60)),
  271. ColorSequenceKeypoint.new(1, Color3.fromRGB(180, 20, 20))
  272. })
  273. -- При повторном включении скрипта
  274. local character = player.Character
  275. if character then
  276. setupZeroGravity(character)
  277. startFlying(character)
  278. end
  279. else
  280. toggleButton.Text = translations[currentLanguage].start
  281. buttonGradient.Color = ColorSequence.new({
  282. ColorSequenceKeypoint.new(0, Color3.fromRGB(60, 255, 60)),
  283. ColorSequenceKeypoint.new(1, Color3.fromRGB(20, 180, 20))
  284. })
  285. -- Отключаем физику при выключении
  286. if bodyVelocity then
  287. bodyVelocity:Destroy()
  288. bodyVelocity = nil
  289. end
  290. -- Останавливаем корутину полета
  291. if flyingCoroutine then
  292. coroutine.close(flyingCoroutine)
  293. flyingCoroutine = nil
  294. end
  295. end
  296. end)
  297.  
  298. -- Функция для обновления счетчиков
  299. local function updateCounters()
  300. while true do
  301. local elapsedTime = os.time() - startTime
  302. local lang = translations[currentLanguage]
  303.  
  304. timeLabel.Text = lang.time .. formatTime(elapsedTime)
  305. goldLabel.Text = lang.earned .. totalEarned .. lang.gold
  306. flightsLabel.Text = lang.flights .. flightsCompleted
  307.  
  308. wait(1)
  309. end
  310. end
  311.  
  312. -- Запускаем обновление счетчиков
  313. coroutine.wrap(updateCounters)()
  314. end
  315.  
  316. -- Функция для установки нулевой гравитации
  317. local function setupZeroGravity(character)
  318. if not character then return end
  319.  
  320. local humanoid = character:FindFirstChildOfClass("Humanoid")
  321. local rootPart = character:FindFirstChild("HumanoidRootPart")
  322.  
  323. if not humanoid or not rootPart then return end
  324.  
  325. -- Удаляем старый BodyVelocity если есть
  326. if bodyVelocity then
  327. bodyVelocity:Destroy()
  328. bodyVelocity = nil
  329. end
  330.  
  331. -- Создаем новый BodyVelocity для контроля полета
  332. bodyVelocity = Instance.new("BodyVelocity")
  333. bodyVelocity.Velocity = Vector3.new(0, 0, 0)
  334. bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  335. bodyVelocity.P = 10000
  336. bodyVelocity.Parent = rootPart
  337.  
  338. -- Отключаем гравитацию
  339. local bodyGyro = Instance.new("BodyGyro")
  340. bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  341. bodyGyro.P = 10000
  342. bodyGyro.D = 500
  343. bodyGyro.Parent = rootPart
  344.  
  345. -- Устанавливаем состояние полета
  346. humanoid:ChangeState(Enum.HumanoidStateType.Flying)
  347. end
  348.  
  349. -- Функция для телепортации к точке
  350. local function teleportToWaypoint(character, point)
  351. if not scriptActive then return end
  352. if not character or not character:FindFirstChild("HumanoidRootPart") then return end
  353.  
  354. local rootPart = character.HumanoidRootPart
  355. setupZeroGravity(character)
  356.  
  357. local tweenInfo = TweenInfo.new(
  358. 1,
  359. Enum.EasingStyle.Quad,
  360. Enum.EasingDirection.InOut,
  361. 0,
  362. false,
  363. 0
  364. )
  365.  
  366. local tween = game:GetService("TweenService"):Create(
  367. rootPart,
  368. tweenInfo,
  369. {CFrame = CFrame.new(point)}
  370. )
  371. tween:Play()
  372. tween.Completed:Wait()
  373.  
  374. -- Фиксируем позицию после твина
  375. if bodyVelocity then
  376. bodyVelocity.Velocity = Vector3.new(0, 0, 0)
  377. end
  378. end
  379.  
  380. -- Основная функция полета
  381. local function flyThroughWaypoints(character)
  382. while scriptActive do
  383. for _, waypoint in ipairs(waypoints) do
  384. if not scriptActive then break end
  385. teleportToWaypoint(character, waypoint)
  386. wait(0.5)
  387. end
  388.  
  389. if scriptActive and character then
  390. -- Увеличиваем счетчики после завершения полета
  391. flightsCompleted = flightsCompleted + 1
  392. totalEarned = totalEarned + goldPerFlight
  393.  
  394. local humanoid = character:FindFirstChildOfClass("Humanoid")
  395. if humanoid then
  396. -- Удаляем физику перед смертью
  397. if bodyVelocity then
  398. bodyVelocity:Destroy()
  399. bodyVelocity = nil
  400. end
  401.  
  402. humanoid.Health = 0
  403. wait(4)
  404.  
  405. -- Ждем возрождения
  406. character = player.Character or player.CharacterAdded:Wait()
  407. wait(1)
  408. -- После ресета снова включаем нулевую гравитацию
  409. if scriptActive then
  410. setupZeroGravity(character)
  411. end
  412. end
  413. end
  414. end
  415. end
  416.  
  417. -- Функция для запуска полета в корутине
  418. local function startFlying(character)
  419. if flyingCoroutine then
  420. coroutine.close(flyingCoroutine)
  421. end
  422. flyingCoroutine = coroutine.create(function()
  423. flyThroughWaypoints(character)
  424. end)
  425. coroutine.resume(flyingCoroutine)
  426. end
  427.  
  428. -- Создаем GUI
  429. createFlightGUI()
  430.  
  431. -- Обработчик изменения персонажа
  432. player.CharacterAdded:Connect(function(character)
  433. if scriptActive and not debounce then
  434. debounce = true
  435. wait(4) -- Даем время на полное появление персонажа
  436. debounce = false
  437. -- При появлении нового персонажа включаем нулевую гравитацию
  438. setupZeroGravity(character)
  439. startFlying(character)
  440. end
  441. end)
  442.  
  443. -- Начальный запуск
  444. local character = player.Character or player.CharacterAdded:Wait()
  445. setupZeroGravity(character)
  446. startFlying(character)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement