if not game:IsLoaded() then game.Loaded:Wait() end local p = game.Players.LocalPlayer local UIS = game:GetService("UserInputService") _G.AutoFarmEnabled = _G.AutoFarmEnabled or false local c = p.Character or p.CharacterAdded:Wait() local root = c:WaitForChild("HumanoidRootPart") p.CharacterAdded:Connect(function(char) c = char root = char:WaitForChild("HumanoidRootPart") end) local tf = workspace:WaitForChild("Treasure") local gui = Instance.new("ScreenGui", p:WaitForChild("PlayerGui")) gui.ResetOnSpawn = false local f = Instance.new("Frame", gui) f.Size = UDim2.new(0,190,0,90) f.Position = UDim2.new(0,20,0,20) f.BackgroundColor3 = Color3.fromRGB(20,20,20) f.BackgroundTransparency = 0.15 f.BorderSizePixel = 0 Instance.new("UICorner", f).CornerRadius = UDim.new(0,10) Instance.new("UIStroke", f).Color = Color3.fromRGB(60,60,60) local t = Instance.new("TextLabel", f) t.Size = UDim2.new(1,-10,0.3,0) t.Position = UDim2.new(0,10,0,5) t.BackgroundTransparency = 1 t.Font = Enum.Font.GothamMedium t.TextSize = 16 t.TextXAlignment = Enum.TextXAlignment.Left t.TextColor3 = Color3.fromRGB(220,220,220) t.Text = "Auto Farm" local s = Instance.new("TextLabel", f) s.Size = UDim2.new(1,-10,0.3,0) s.Position = UDim2.new(0,10,0.35,0) s.BackgroundTransparency = 1 s.Font = Enum.Font.Gotham s.TextSize = 14 s.TextXAlignment = Enum.TextXAlignment.Left s.TextColor3 = Color3.fromRGB(140,140,140) local box = Instance.new("Frame", f) box.Size = UDim2.new(0,18,0,18) box.Position = UDim2.new(0,10,1,-28) box.BackgroundColor3 = Color3.fromRGB(40,40,40) Instance.new("UICorner", box).CornerRadius = UDim.new(0,4) local check = Instance.new("TextLabel", box) check.Size = UDim2.new(1,0,1,0) check.BackgroundTransparency = 1 check.Text = "✓" check.Font = Enum.Font.GothamBold check.TextScaled = true local lbl = Instance.new("TextLabel", f) lbl.Size = UDim2.new(0,120,0,18) lbl.Position = UDim2.new(0,35,1,-28) lbl.BackgroundTransparency = 1 lbl.Text = "Enabled" lbl.Font = Enum.Font.Gotham lbl.TextSize = 14 lbl.TextXAlignment = Enum.TextXAlignment.Left local function ui() if _G.AutoFarmEnabled then check.TextTransparency = 0 check.TextColor3 = Color3.fromRGB(0,200,120) s.Text = "Status: Running" lbl.TextColor3 = Color3.fromRGB(200,200,200) else check.TextTransparency = 1 s.Text = "Status: Idle" lbl.TextColor3 = Color3.fromRGB(120,120,120) end end ui() local function toggle() _G.AutoFarmEnabled = not _G.AutoFarmEnabled ui() if _G.AutoFarmEnabled then task.spawn(farmLoop) end end box.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 then toggle() end end) lbl.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 then toggle() end end) local drag,di,ds,sp f.InputBegan:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then drag=true ds=i.Position sp=f.Position i.Changed:Connect(function() if i.UserInputState==Enum.UserInputState.End then drag=false end end) end end) f.InputChanged:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseMovement then di=i end end) UIS.InputChanged:Connect(function(i) if i==di and drag then local d=i.Position-ds f.Position=UDim2.new(sp.X.Scale,sp.X.Offset+d.X,sp.Y.Scale,sp.Y.Offset+d.Y) end end) local function sp(p) if p:IsA("ProximityPrompt") then p.HoldDuration = 0 p.MaxActivationDistance = math.huge end end for _,v in ipairs(tf:GetDescendants()) do sp(v) end tf.DescendantAdded:Connect(sp)