local Players = game:GetService("Players")
local player = Players.LocalPlayer
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "TestAutoFarmUI"
screenGui.ResetOnSpawn = false -- This keeps the UI on screen when you die!
screenGui.Parent = player:WaitForChild("PlayerGui")
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 220, 0, 70)
frame.Position = UDim2.new(0.5, -110, 0, 20)
frame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
frame.Active = true
frame.Draggable = true -- Makes the UI draggable!
frame.Parent = screenGui
local frameCorner = Instance.new("UICorner")
frameCorner.CornerRadius = UDim.new(0, 10)
frameCorner.Parent = frame
local stroke = Instance.new("UIStroke")
stroke.Color = Color3.fromRGB(200, 50, 50)
stroke.Thickness = 2
stroke.Parent = frame
local toggleBtn = Instance.new("TextButton")
toggleBtn.Size = UDim2.new(1, -20, 1, -20)
toggleBtn.Position = UDim2.new(0, 10, 0, 10)
toggleBtn.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
toggleBtn.TextColor3 = Color3.new(1, 1, 1)
toggleBtn.Font = Enum.Font.GothamBold
toggleBtn.TextSize = 16
toggleBtn.Text = "Auto-Teleport: OFF"
toggleBtn.Parent = frame
local btnCorner = Instance.new("UICorner")
btnCorner.CornerRadius = UDim.new(0, 6)
btnCorner.Parent = toggleBtn
local isFarming = false
local function getCurrentGoalPart()
local funcFolder = workspace:FindFirstChild("FunctionalFolder")
if not funcFolder then return nil end
local obbyFolder = funcFolder:FindFirstChild("ObbyFolder")
if not obbyFolder then return nil end
for _, child in ipairs(obbyFolder:GetChildren()) do
if string.match(child.Name, "Obby") then
local goalPart = child:FindFirstChild("GoalPart")
if goalPart then
return goalPart
end
end
end
return nil
end
toggleBtn.MouseButton1Click:Connect(function()
isFarming = not isFarming
if isFarming then
toggleBtn.BackgroundColor3 = Color3.fromRGB(50, 200, 50)
stroke.Color = Color3.fromRGB(50, 200, 50)
toggleBtn.Text = "Auto-Teleport: ON"
task.spawn(function()
while isFarming do
local char = player.Character
if char and char:FindFirstChild("HumanoidRootPart") then
local goalPart = getCurrentGoalPart()
if goalPart then
char.HumanoidRootPart.CFrame = goalPart.CFrame
end
end
task.wait()
end
end)
else
toggleBtn.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
stroke.Color = Color3.fromRGB(200, 50, 50)
toggleBtn.Text = "Auto-Teleport: OFF"
end
end)
Comments
No comments yet
Be the first to share your thoughts!