-- [[ Rscripts Risk Notice ]] -- This script is not verified by rscripts.net. Deal with caution. -- -- Stay safe: -- • Never log in on unofficial Roblox sites or lookalike domains. -- • Real Roblox links use roblox.com (check the .com ending). -- • Treat fake Roblox login / "claim reward" pages as phishing. -- [[ End Rscripts Risk Notice ]] --[[ HackerAI Hub v4 | Clean the Golf Yard | Delta mobile - Real Rayfield UI from sirius.menu - Auto Farm: teleport-to-ball + Collect2 (works regardless of distance) - Auto Sell: teleport to basket + click it + sell remote fallback - Upgrade All: auto-buys bigger hand / capacity ]] print("[HackerAI] v4 starting...") -- ============ LOAD RAYFIELD (official + mirrors) ============ local Rayfield for _, url in ipairs({ "https://sirius.menu/rayfield", "https://raw.githubusercontent.com/SiriusSoftwareLtd/Rayfield/main/source", "https://raw.githubusercontent.com/shlexware/Rayfield/main/source", }) do local ok, res = pcall(function() local f = loadstring(game:HttpGet(url)) assert(f, "loadstring returned nil") return f() end) if ok and type(res) == "table" and res.CreateWindow then Rayfield = res break end end if not Rayfield then error("[HackerAI] Could not load Rayfield. Your executor blocked HttpGet (Delta supports it).") end -- ============ CONFIG ============ local env = getgenv and getgenv() or _G env.HackerAI_CGY = env.HackerAI_CGY or {} local C = env.HackerAI_CGY C.AutoFarm = C.AutoFarm ~= nil and C.AutoFarm or false C.AutoSell = C.AutoSell ~= nil and C.AutoSell or false C.UpgradeAll = C.UpgradeAll ~= nil and C.UpgradeAll or false -- ============ SERVICES / GAME STRUCTURE ============ local Players = game:GetService("Players") local RS = game:GetService("ReplicatedStorage") local LP = Players.LocalPlayer local function findBalls() local f = workspace:FindFirstChild("ActiveGolfBalls") if f then return f end for _, c in ipairs(workspace:GetChildren()) do if (c:IsA("Folder") or c:IsA("Model")) and (c.Name:lower():find("golf") or c.Name:lower():find("ball")) then return c end end return nil end local function findRemotes() local f = RS:FindFirstChild("RemotesNew") if f then return f end for _, c in ipairs(RS:GetChildren()) do if c:IsA("Folder") and c.Name:lower():find("remote") then return c end end return nil end local networker pcall(function() local m = RS:FindFirstChild("Modules") local r = m and m:FindFirstChild("rwque") local p = r and r:FindFirstChild("Packages") local n = p and p:FindFirstChild("Networker") if n then networker = require(n).new() end end) local function fireServer(name, ...) if networker then networker:FireServer(name, ...) return end local remotes = findRemotes() local r = remotes and remotes:FindFirstChild(name) if r then r:FireServer(...) end end local function safeFire(name, ...) local args = table.pack(...) return pcall(function() fireServer(name, table.unpack(args, 1, args.n)) end) end local function getAttr(n, f) local v = LP:GetAttribute(n) return type(v) == "number" and v or f end local function getRoot() local c = LP.Character return c and c:FindFirstChild("HumanoidRootPart") end local function teleport(pos) local root = getRoot() if not root then return false end pcall(function() root.AssemblyLinearVelocity = Vector3.zero root.AssemblyAngularVelocity = Vector3.zero root.CFrame = CFrame.new(pos + Vector3.new(0, 2.5, 0)) end) task.wait(0.06) return true end -- ============ AUTO FARM (teleport + Collect2) ============ local lastCollect = 0 local function farmTick() local balls = findBalls() local root = getRoot() if not (balls and root) then return end -- nearest ball on the whole map local target, bestD = nil, math.huge for _, b in ipairs(balls:GetChildren()) do if b:IsA("BasePart") then local d = (b.Position - root.Position).Magnitude if d < bestD then target, bestD = b, d end end end if not target then return end teleport(target.Position) -- get server-side in range -- batch everything within hand range of our new position local radius = getAttr("CollectionRange") or 60 local batch = {} for _, b in ipairs(balls:GetChildren()) do if b:IsA("BasePart") and (b.Position - root.Position).Magnitude <= radius then table.insert(batch, b) if #batch >= 150 then break end end end if #batch > 0 then safeFire("Collect2", batch) end end -- ============ AUTO SELL (teleport to basket + click) ============ local function basketParts() local out = {} for _, o in ipairs(workspace:GetDescendants()) do if o:IsA("BasePart") then local n = (o.Name .. " " .. (o.Parent and o.Parent.Name or "")):lower() if n:find("basket") or n:find("deposit") or n:find("sell") or n:find("bin") or n:find("trash") or n:find("cash") then table.insert(out, o) end end end return out end local function clickObject(o) local det = o:FindFirstChildWhichIsA("ClickDetector") if det then if fireclickdetector then pcall(fireclickdetector, det) end pcall(function() det.MouseClick:Fire(LP) end) end local pr = o:FindFirstChildWhichIsA("ProximityPrompt") if pr then pcall(function() pr.MaxActivationDistance = math.max(pr.MaxActivationDistance or 32, 60) pr.RequiresLineOfSight = false end) if fireproximityprompt then pcall(fireproximityprompt, pr) end pcall(function() pr:InputHoldBegin() end) task.wait(0.1) pcall(function() pr:InputHoldEnd() end) end end local sellRemoteName local function findSellRemote() if sellRemoteName then return sellRemoteName end local remotes = findRemotes() if not remotes then return nil end for _, r in ipairs(remotes:GetChildren()) do if r:IsA("RemoteEvent") then local n = r.Name:lower() if n:find("sell") or n:find("deposit") or n:find("cash") or n:find("bank") or n:find("basket") then sellRemoteName = r.Name return sellRemoteName end end end return nil end local function bagFull() local c, cap = getAttr("BagCount"), getAttr("BagCapacity") return (c and cap and c >= cap) or false end local function sellTick() local baskets = basketParts() if #baskets == 0 then local rn = findSellRemote() if rn then pcall(function() fireServer(rn) end) end return end local root = getRoot() if not root then return end local best, bestD = baskets[1], (baskets[1].Position - root.Position).Magnitude for _, b in ipairs(baskets) do local d = (b.Position - root.Position).Magnitude if d < bestD then best, bestD = b, d end end teleport(best.Position) for _, b in ipairs(baskets) do if (b.Position - best.Position).Magnitude <= 15 then clickObject(b) end end task.wait(0.3) local rn = findSellRemote() if rn then pcall(function() fireServer(rn) end) end end -- ============ UPGRADE ALL ============ local upgradeNames = { "BuyAllShop", "BuyAll", "UpgradeAll", "BuyShop" } local function upgradeTick() local remotes = findRemotes() if not remotes then return end for _, n in ipairs(upgradeNames) do if remotes:FindFirstChild(n) then safeFire(n) break end end end -- ============ MAIN LOOPS (respawn-safe, isolated) ============ task.spawn(function() while true do task.wait(0.3) if C.AutoFarm then pcall(farmTick) local cd = math.max(0.05, getAttr("CollectCooldown", 0.1)) task.wait(math.max(0, cd - 0.3)) end end end) task.spawn(function() while true do task.wait(1) if C.AutoSell and bagFull() then pcall(sellTick) end end end) task.spawn(function() while true do task.wait(0.5) if C.UpgradeAll then pcall(upgradeTick) end end end) -- ============ RAYFIELD UI ============ local Window = Rayfield:CreateWindow({ Name = "HackerAI | Clean the Golf Yard", LoadingTitle = "HackerAI Hub", LoadingSubtitle = "Auto Farm · Auto Sell · Upgrade All", ShowText = "HackerAI", -- mobile show/hide button ConfigurationSaving = { Enabled = true, FolderName = "HackerAI", FileName = "CleanGolfYard", }, Discord = { Enabled = false }, KeySystem = false, }) local Farm = Window:CreateTab("Auto Farm", 0) local Sell = Window:CreateTab("Sell & Upgrade", 0) local Info = Window:CreateTab("Info", 0) Farm:CreateSection("Farming") Farm:CreateToggle({ Name = "Auto Farm (teleport)", CurrentValue = C.AutoFarm, Flag = "AutoFarm", Callback = function(v) C.AutoFarm = v end, }) Farm:CreateButton({ Name = "Collect Now", Callback = function() pcall(farmTick) end, }) local Status = Farm:CreateLabel("Status: waiting...") Sell:CreateSection("Selling") Sell:CreateToggle({ Name = "Auto Sell (when full)", CurrentValue = C.AutoSell, Flag = "AutoSell", Callback = function(v) C.AutoSell = v end, }) Sell:CreateButton({ Name = "Sell Now", Callback = function() pcall(sellTick) end, }) Sell:CreateSection("Upgrades") Sell:CreateToggle({ Name = "Upgrade All", CurrentValue = C.UpgradeAll, Flag = "UpgradeAll", Callback = function(v) C.UpgradeAll = v end, }) Info:CreateParagraph({ Title = "How it works", Content = "Auto Farm teleports to the nearest golf ball, then fires Collect2 with every ball inside your hand range. Auto Sell teleports to the nearest basket, clicks it, and fires the sell remote as backup. Upgrade All buys bigger hand / capacity automatically.", }) task.spawn(function() while true do pcall(function() local balls = findBalls() Status:Set(string.format("Bag %s/%s | Hand %s | Balls %d", tostring(getAttr("BagCount") or "?"), tostring(getAttr("BagCapacity") or "?"), tostring(getAttr("CollectionRange") or "?"), balls and #balls:GetChildren() or 0)) end) task.wait(1) end end) Rayfield:LoadConfiguration() print("[HackerAI] v4 loaded. Toggle Auto Farm ON.")