Advertisement
kill21_2

ohio afto farm

May 4th, 2025
6,271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.64 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local UserInputService = game:GetService("UserInputService")
  4. local TweenService = game:GetService("TweenService")
  5.  
  6. -- Настройки
  7. local TELEPORT_DELAY = 3 -- Задержка между телепортациями
  8. local ABOVE_BOX_HEIGHT = 3 -- Высота над ящиком
  9.  
  10. -- Состояние
  11. local isTeleporting = false
  12. local currentPlayer = nil
  13. local foundBoxes = {}
  14. local stopTeleport = false
  15. local dragging = false
  16. local dragStartPos, frameStartPos
  17.  
  18. -- Создаем красивый GUI
  19. local screenGui = Instance.new("ScreenGui")
  20. screenGui.Name = "ComponentBoxTeleporter"
  21. screenGui.ResetOnSpawn = false
  22.  
  23. local mainFrame = Instance.new("Frame")
  24. mainFrame.Size = UDim2.new(0, 320, 0, 240)
  25. mainFrame.Position = UDim2.new(0.5, -160, 0.5, -120)
  26. mainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
  27. mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
  28. mainFrame.BorderSizePixel = 0
  29. mainFrame.ClipsDescendants = true
  30.  
  31. -- Скругленные углы
  32. local corner = Instance.new("UICorner")
  33. corner.CornerRadius = UDim.new(0, 8)
  34. corner.Parent = mainFrame
  35.  
  36. -- Тень
  37. local shadow = Instance.new("ImageLabel")
  38. shadow.Name = "Shadow"
  39. shadow.Image = "rbxassetid://1316045217"
  40. shadow.ImageColor3 = Color3.new(0, 0, 0)
  41. shadow.ImageTransparency = 0.8
  42. shadow.ScaleType = Enum.ScaleType.Slice
  43. shadow.SliceCenter = Rect.new(10, 10, 118, 118)
  44. shadow.Size = UDim2.new(1, 20, 1, 20)
  45. shadow.Position = UDim2.new(0, -10, 0, -10)
  46. shadow.BackgroundTransparency = 1
  47. shadow.Parent = mainFrame
  48.  
  49. -- Заголовок с кнопкой закрытия
  50. local titleBar = Instance.new("Frame")
  51. titleBar.Size = UDim2.new(1, 0, 0, 32)
  52. titleBar.Position = UDim2.new(0, 0, 0, 0)
  53. titleBar.BackgroundColor3 = Color3.fromRGB(25, 25, 35)
  54. titleBar.BorderSizePixel = 0
  55. titleBar.Name = "TitleBar"
  56.  
  57. local titleCorner = Instance.new("UICorner")
  58. titleCorner.CornerRadius = UDim.new(0, 8)
  59. titleCorner.Parent = titleBar
  60.  
  61. local title = Instance.new("TextLabel")
  62. title.Text = "COMPONENT BOX TELEPORTER"
  63. title.Size = UDim2.new(1, -40, 1, 0)
  64. title.Position = UDim2.new(0, 10, 0, 0)
  65. title.BackgroundTransparency = 1
  66. title.TextColor3 = Color3.fromRGB(220, 220, 220)
  67. title.Font = Enum.Font.GothamBold
  68. title.TextSize = 14
  69. title.TextXAlignment = Enum.TextXAlignment.Left
  70. title.Parent = titleBar
  71.  
  72. local closeButton = Instance.new("ImageButton")
  73. closeButton.Size = UDim2.new(0, 24, 0, 24)
  74. closeButton.Position = UDim2.new(1, -30, 0.5, -12)
  75. closeButton.BackgroundTransparency = 1
  76. closeButton.Image = "rbxassetid://3926305904"
  77. closeButton.ImageRectOffset = Vector2.new(284, 4)
  78. closeButton.ImageRectSize = Vector2.new(24, 24)
  79. closeButton.ImageColor3 = Color3.fromRGB(200, 200, 200)
  80. closeButton.Parent = titleBar
  81.  
  82. titleBar.Parent = mainFrame
  83.  
  84. -- Основное содержимое
  85. local contentFrame = Instance.new("Frame")
  86. contentFrame.Size = UDim2.new(1, -20, 1, -72)
  87. contentFrame.Position = UDim2.new(0, 10, 0, 42)
  88. contentFrame.BackgroundTransparency = 1
  89. contentFrame.Parent = mainFrame
  90.  
  91. -- Информационные метки
  92. local function createInfoLabel(text, yPos)
  93. local frame = Instance.new("Frame")
  94. frame.Size = UDim2.new(1, 0, 0, 20)
  95. frame.Position = UDim2.new(0, 0, 0, yPos)
  96. frame.BackgroundTransparency = 1
  97.  
  98. local icon = Instance.new("ImageLabel")
  99. icon.Size = UDim2.new(0, 16, 0, 16)
  100. icon.Position = UDim2.new(0, 0, 0.5, -8)
  101. icon.BackgroundTransparency = 1
  102. icon.Image = "rbxassetid://3926305904"
  103. icon.ImageColor3 = Color3.fromRGB(120, 170, 255)
  104. icon.Parent = frame
  105.  
  106. local label = Instance.new("TextLabel")
  107. label.Text = text
  108. label.Size = UDim2.new(1, -25, 1, 0)
  109. label.Position = UDim2.new(0, 25, 0, 0)
  110. label.TextColor3 = Color3.fromRGB(200, 200, 200)
  111. label.Font = Enum.Font.Gotham
  112. label.TextSize = 14
  113. label.TextXAlignment = Enum.TextXAlignment.Left
  114. label.BackgroundTransparency = 1
  115. label.Parent = frame
  116.  
  117. return label
  118. end
  119.  
  120. local infoLabel = createInfoLabel("Найдено ящиков: 0", 0)
  121. infoLabel.Name = "InfoLabel"
  122. infoLabel.Parent = contentFrame
  123.  
  124. local progressLabel = createInfoLabel("Прогресс: -/-", 30)
  125. progressLabel.Name = "ProgressLabel"
  126. progressLabel.Parent = contentFrame
  127.  
  128. local currentPosLabel = createInfoLabel("Текущая позиция: -", 60)
  129. currentPosLabel.Name = "CurrentPosLabel"
  130. currentPosLabel.Size = UDim2.new(1, -25, 0, 60)
  131. currentPosLabel.TextWrapped = true
  132. currentPosLabel.Parent = contentFrame
  133.  
  134. -- Кнопка старта/остановки
  135. local toggleButton = Instance.new("TextButton")
  136. toggleButton.Text = "СТАРТ"
  137. toggleButton.Size = UDim2.new(0, 140, 0, 36)
  138. toggleButton.Position = UDim2.new(0.5, -70, 1, -50)
  139. toggleButton.AnchorPoint = Vector2.new(0.5, 1)
  140. toggleButton.BackgroundColor3 = Color3.fromRGB(70, 130, 200)
  141. toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  142. toggleButton.Font = Enum.Font.GothamBold
  143. toggleButton.TextSize = 14
  144. toggleButton.AutoButtonColor = false
  145.  
  146. -- Стиль кнопки
  147. local buttonCorner = Instance.new("UICorner")
  148. buttonCorner.CornerRadius = UDim.new(0, 6)
  149. buttonCorner.Parent = toggleButton
  150.  
  151. local buttonStroke = Instance.new("UIStroke")
  152. buttonStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  153. buttonStroke.Color = Color3.fromRGB(100, 160, 220)
  154. buttonStroke.Thickness = 2
  155. buttonStroke.Parent = toggleButton
  156.  
  157. -- Эффект наведения
  158. toggleButton.MouseEnter:Connect(function()
  159. game:GetService("TweenService"):Create(toggleButton, TweenInfo.new(0.1), {BackgroundColor3 = Color3.fromRGB(90, 150, 220)}):Play()
  160. end)
  161.  
  162. toggleButton.MouseLeave:Connect(function()
  163. game:GetService("TweenService"):Create(toggleButton, TweenInfo.new(0.1), {BackgroundColor3 = isTeleporting and Color3.fromRGB(200, 80, 80) or Color3.fromRGB(70, 130, 200)}):Play()
  164. end)
  165.  
  166. toggleButton.Parent = mainFrame
  167. mainFrame.Parent = screenGui
  168.  
  169. -- Функции для перемещения GUI
  170. local function startDrag(input)
  171. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  172. dragging = true
  173. dragStartPos = input.Position
  174. frameStartPos = mainFrame.Position
  175. input.Changed:Connect(function()
  176. if input.UserInputState == Enum.UserInputState.End then
  177. dragging = false
  178. end
  179. end)
  180. end
  181. end
  182.  
  183. local function updateDrag(input)
  184. if dragging then
  185. local delta = input.Position - dragStartPos
  186. mainFrame.Position = UDim2.new(frameStartPos.X.Scale, frameStartPos.X.Offset + delta.X, frameStartPos.Y.Scale, frameStartPos.Y.Offset + delta.Y)
  187. end
  188. end
  189.  
  190. titleBar.InputBegan:Connect(startDrag)
  191. titleBar.InputChanged:Connect(updateDrag)
  192.  
  193. -- Закрытие GUI
  194. closeButton.MouseButton1Click:Connect(function()
  195. screenGui:Destroy()
  196. end)
  197.  
  198. closeButton.MouseEnter:Connect(function()
  199. closeButton.ImageColor3 = Color3.fromRGB(255, 100, 100)
  200. end)
  201.  
  202. closeButton.MouseLeave:Connect(function()
  203. closeButton.ImageColor3 = Color3.fromRGB(200, 200, 200)
  204. end)
  205.  
  206. -- Остальные функции (без изменений)
  207. local function findComponentBoxes()
  208. local itemPickups = workspace.Game.Entities.ItemPickup:GetChildren()
  209. local foundItems = {}
  210.  
  211. for _, item in ipairs(itemPickups) do
  212. if item:GetAttribute("itemName") == "Component Box" then
  213. local position = item:GetPivot().Position
  214. table.insert(foundItems, {
  215. item = item,
  216. position = position + Vector3.new(0, ABOVE_BOX_HEIGHT, 0)
  217. })
  218. end
  219. end
  220.  
  221. return foundItems
  222. end
  223.  
  224. local function smoothTeleport(character, position)
  225. if not character or not character:FindFirstChild("HumanoidRootPart") then
  226. return false
  227. end
  228.  
  229. local humanoidRootPart = character.HumanoidRootPart
  230. local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  231. local tween = TweenService:Create(humanoidRootPart, tweenInfo, {CFrame = CFrame.new(position)})
  232. tween:Play()
  233.  
  234. return true
  235. end
  236.  
  237. local function teleportPlayerToBoxes(player)
  238. if not player.Character then
  239. player.CharacterAdded:Wait()
  240. end
  241.  
  242. for i, boxData in ipairs(foundBoxes) do
  243. if stopTeleport then break end
  244.  
  245. progressLabel.Text = string.format("Прогресс: %d/%d", i, #foundBoxes)
  246. currentPosLabel.Text = string.format("Текущая позиция: %s\n(%.1f, %.1f, %.1f)",
  247. boxData.item.Name, boxData.position.X, boxData.position.Y, boxData.position.Z)
  248.  
  249. if smoothTeleport(player.Character, boxData.position) then
  250. local elapsed = 0
  251. while elapsed < TELEPORT_DELAY and not stopTeleport do
  252. elapsed += wait(0.1)
  253. end
  254. end
  255. end
  256.  
  257. isTeleporting = false
  258. stopTeleport = false
  259. toggleButton.Text = "СТАРТ"
  260. toggleButton.BackgroundColor3 = Color3.fromRGB(70, 130, 200)
  261.  
  262. if not stopTeleport then
  263. currentPosLabel.Text = "Телепортация завершена!"
  264. else
  265. currentPosLabel.Text = "Телепортация остановлена"
  266. end
  267. end
  268.  
  269. toggleButton.MouseButton1Click:Connect(function()
  270. if isTeleporting then
  271. stopTeleport = true
  272. toggleButton.BackgroundColor3 = Color3.fromRGB(70, 130, 200)
  273. return
  274. end
  275.  
  276. isTeleporting = true
  277. stopTeleport = false
  278. toggleButton.Text = "СТОП"
  279. toggleButton.BackgroundColor3 = Color3.fromRGB(200, 80, 80)
  280.  
  281. foundBoxes = findComponentBoxes()
  282. infoLabel.Text = string.format("Найдено ящиков: %d", #foundBoxes)
  283.  
  284. if #foundBoxes == 0 then
  285. currentPosLabel.Text = "Ящики не найдены!"
  286. isTeleporting = false
  287. toggleButton.Text = "СТАРТ"
  288. toggleButton.BackgroundColor3 = Color3.fromRGB(70, 130, 200)
  289. return
  290. end
  291.  
  292. local player = Players.LocalPlayer
  293. currentPlayer = player
  294.  
  295. coroutine.wrap(function()
  296. teleportPlayerToBoxes(player)
  297. end)()
  298. end)
  299.  
  300. -- Инициализация
  301. if RunService:IsClient() then
  302. screenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
  303. else
  304. Players.PlayerAdded:Connect(function(player)
  305. local playerGui = player:WaitForChild("PlayerGui")
  306. local guiClone = screenGui:Clone()
  307. guiClone.Parent = playerGui
  308. end)
  309.  
  310. for _, player in ipairs(Players:GetPlayers()) do
  311. local playerGui = player:WaitForChild("PlayerGui")
  312. local guiClone = screenGui:Clone()
  313. guiClone.Parent = playerGui
  314. end
  315. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement