--[[rscripts:analytics:start]] -- Script analytics (enabled by the creator on rscripts.net). -- Runs in its own thread and cannot affect the script below. task.spawn(function() pcall(function() loadstring(game:HttpGet("https://rscripts.net/api/telemetry/v2/client.lua?s=6a32721e668fc8bddca056ff"))() end) end) --[[rscripts:analytics:end]] local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() local Players = game:GetService("Players") local RS = game:GetService("ReplicatedStorage") local LP = Players.LocalPlayer local VirtualUser = game:GetService("VirtualUser") LP.Idled:Connect(function() VirtualUser:Button2Down(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) task.wait(1) VirtualUser:Button2Up(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) end) local Systems = RS:WaitForChild("Modules"):WaitForChild("Systems") local DataServiceClient = require(Systems.Data.Services.DataServiceClient) local FloorServiceClient = require(Systems.Floor.Services.FloorServiceClient) local FloorShared = require(Systems.Floor.Services.FloorShared) local BuildingShared = require(Systems.Building.Services.BuildingShared) local NPCConfig = require(Systems.NPC.Services.NPCConfig) local RebirthShared = require(Systems.Rebirth.Services.RebirthShared) local FunctionUtils = require(RS.Modules.Utility.FunctionUtils) local BuyNPC = Systems.Shop.Services.ShopNetwork:WaitForChild("_buyNPC") local PlaceNPC = Systems.Building.Services.BuildingNetwork:WaitForChild("_placeNPC") local BuyFloor = Systems.Floor.Services.FloorNetwork:WaitForChild("_buyFloor") local DoRebirth = Systems.Rebirth.Services.RebirthNetwork:WaitForChild("_doRebirth") local MaxRebirth = Systems.Rebirth.Services.RebirthNetwork:WaitForChild("_maxRebirth") local GRID = BuildingShared.GRID_COUNT or 13 -- cells per side (0..GRID-1) local PLACE_ROTATION = 270 -- client default local MAX_FLOORS = FloorShared.MAX_FLOORS or 3 local REBIRTH_OPTIONS = RebirthShared.REBIRTH_OPTIONS local function abbrev(n) local ok, s = pcall(function() return FunctionUtils.Format.abbreviateCash(n, 2) end) if ok and s then return s end return tostring(n) end local function getData(key) local ok, v = pcall(function() return DataServiceClient:GetDataValue(key) end) if ok then return v end return nil end local function getCash() return tonumber(getData("Cash")) or 0 end local function getInventory() return getData("NPCInventory") or {} end local function getFloorNames() local ok, names = pcall(function() return FloorServiceClient:GetLocalFloorNames() end) if ok and type(names) == "table" then return names end return { "StartingFloor" } end local function getNPCFolder(floorName) local ok, bp = pcall(function() return FloorServiceClient:GetBasePlateFromFloor(floorName) end) if not (ok and bp) then return nil end local floorModel = bp.Parent return floorModel and floorModel:FindFirstChild("NPCs") end local function fakeTouch(part) local char = LP.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") if not (hrp and part and firetouchinterest) then return end firetouchinterest(hrp, part, 0) -- enter firetouchinterest(hrp, part, 1) -- leave (re-arms the trigger) end local function collectAll() for _, floorName in ipairs(getFloorNames()) do local folder = getNPCFolder(floorName) if folder then for _, d in ipairs(folder:GetDescendants()) do if d:IsA("BasePart") and d.CanTouch then fakeTouch(d) end end end end end local badCells = {} -- badCells[floor][gridKey] = true local function gridKey(x, z) return x .. "_" .. z end local function occupiedFor(floorName) local occ = {} for _, dataKey in ipairs({ "PlacedNPCs", "PlacedCrates", "PlacedTotems" }) do local placed = getData(dataKey) local cells = type(placed) == "table" and placed[floorName] if type(cells) == "table" then for k in pairs(cells) do occ[k] = true end end end if badCells[floorName] then for k in pairs(badCells[floorName]) do occ[k] = true end end return occ end local function placeOwned(maxPlacements) local placed = 0 for _, floorName in ipairs(getFloorNames()) do local occ = occupiedFor(floorName) badCells[floorName] = badCells[floorName] or {} local inv = getInventory() for npcName, count in pairs(inv) do count = tonumber(count) or 0 local gx, gz = 0, 0 while count > 0 and gz < GRID do local key = gridKey(gx, gz) if not occ[key] then local ok, res = pcall(function() return PlaceNPC:InvokeServer(npcName, floorName, gx, gz, PLACE_ROTATION) end) if ok and res == true then occ[key] = true count = count - 1 placed = placed + 1 if maxPlacements and placed >= maxPlacements then return placed end else -- still had inventory but server said no → cell unusable badCells[floorName][key] = true occ[key] = true end end gx = gx + 1 if gx >= GRID then gx = 0; gz = gz + 1 end end end end return placed end local function nextFloorNum() return #getFloorNames() + 1 end local function floorPrice(n) local ok, p = pcall(function() return FloorShared.GetFloorPrice(n) end) return (ok and p) or math.huge end local function buyNextFloor() local n = nextFloorNum() if n <= MAX_FLOORS and getCash() >= floorPrice(n) then local ok, res = pcall(function() return BuyFloor:InvokeServer(n) end) return ok and res ~= false end return false end local function buildBuyables() local entries = {} for name, cfg in pairs(NPCConfig.NPCs) do if cfg.CashPrice ~= nil then table.insert(entries, { name = name, price = cfg.CashPrice }) end end table.sort(entries, function(a, b) return a.price < b.price end) local display, toName, priceOf = {}, {}, {} for _, e in ipairs(entries) do local label = e.name .. " — $" .. abbrev(e.price) table.insert(display, label) toName[label] = e.name priceOf[e.name] = e.price end return display, toName, priceOf end local buyDisplay, buyToName, buyPriceOf = buildBuyables() -- │ GUI │ local Window = Rayfield:CreateWindow({ Name = "Become a Billionaire - Fabron's Hub", LoadingTitle = "Loading...", LoadingSubtitle = "Fabron's Hub is loading, please wait..", ConfigurationSaving = { Enabled = true, FolderName = "Become a Billionaire", FileName = "Config" }, KeySystem = false, }) local MainTab = Window:CreateTab("Main", 4483362458) local statLabel = MainTab:CreateParagraph({ Title = "Live Stats", Content = "Reading..." }) task.spawn(function() while task.wait(2) do local placedCount = 0 local pn = getData("PlacedNPCs") if type(pn) == "table" then for _, cells in pairs(pn) do for _ in pairs(cells) do placedCount = placedCount + 1 end end end statLabel:Set({ Title = "Live Stats", Content = ("Cash: $%s | Rebirths: %s | Placed NPCs: %d | Floors: %d/%d") :format(abbrev(getCash()), tostring(getData("Rebirths") or 0), placedCount, #getFloorNames(), MAX_FLOORS), }) end end) MainTab:CreateSection("Auto Collect") local autoCollect = false MainTab:CreateToggle({ Name = "Auto Collect Money", CurrentValue = false, Flag = "toggle_AutoCollect", Callback = function(state) autoCollect = state if not state then return end task.spawn(function() while autoCollect do collectAll() task.wait(0.5) end end) end, }) MainTab:CreateSection("Auto Place") local autoPlace = false MainTab:CreateToggle({ Name = "Auto Place NPCs", CurrentValue = false, Flag = "toggle_AutoPlace", Callback = function(state) autoPlace = state if not state then return end task.spawn(function() while autoPlace do placeOwned(60) -- bounded sweep per cycle task.wait(1) end end) end, }) MainTab:CreateButton({ Name = "Place All Now", Callback = function() placeOwned(nil) end, }) MainTab:CreateSection("Auto Buy Floor") local autoBuyFloor = false MainTab:CreateToggle({ Name = ("Auto Buy next floor (up to %d)"):format(MAX_FLOORS), CurrentValue = false, Flag = "toggle_AutoBuyFloor", Callback = function(state) autoBuyFloor = state if not state then return end task.spawn(function() while autoBuyFloor do buyNextFloor() task.wait(2) end end) end, }) local BuyTab = Window:CreateTab("Buy", 4483362458) BuyTab:CreateSection("Auto Buy") local MAX_BUYS_PER_CYCLE = 50 local selectedBuys = {} BuyTab:CreateDropdown({ Name = "NPCs to Buy", Options = buyDisplay, CurrentOption = {}, MultipleOptions = true, Flag = "dropdown_BuyNPCs", Callback = function(selection) selectedBuys = {} for _, label in ipairs(selection) do local name = buyToName[label] if name then table.insert(selectedBuys, name) end end end, }) local autoBuy = false BuyTab:CreateToggle({ Name = "Auto Buy NPCs", CurrentValue = false, Flag = "toggle_AutoBuy", Callback = function(state) autoBuy = state if not state then return end task.spawn(function() while autoBuy do for _, name in ipairs(selectedBuys) do local price = buyPriceOf[name] or math.huge local bought = 0 while autoBuy and getCash() >= price and bought < MAX_BUYS_PER_CYCLE do local ok, res = pcall(function() return BuyNPC:InvokeServer(name, 1) end) if not (ok and res == true) then break end -- server refused (locked / broke) bought = bought + 1 task.wait(0.05) end end task.wait(0.5) end end) end, }) local RebirthTab = Window:CreateTab("Rebirth", 4483362458) -- Build option labels; default to the "+5 Rebirth Points" option (idx 3). local rebirthDisplay, rebirthToIdx = {}, {} for i, opt in ipairs(REBIRTH_OPTIONS) do local label = ("[%d] %s"):format(i, opt.Label) table.insert(rebirthDisplay, label) rebirthToIdx[label] = i end local selectedRebirthIdx = math.min(3, #REBIRTH_OPTIONS) local function rebirthCost(idx) local opt = REBIRTH_OPTIONS[idx] if not opt then return math.huge end local ok, cost = pcall(function() return RebirthShared.GetOptionTotalCost(getData("RebirthPrice") or 0, opt) end) return (ok and cost) or math.huge end local rebirthInfo = RebirthTab:CreateParagraph({ Title = "Rebirth", Content = "Reading..." }) local function refreshRebirthInfo() local opt = REBIRTH_OPTIONS[selectedRebirthIdx] rebirthInfo:Set({ Title = "Rebirth", Content = opt and ("Cost: $%s | Cash: $%s"):format( abbrev(rebirthCost(selectedRebirthIdx)), abbrev(getCash())) or "None", }) end RebirthTab:CreateSection("Auto Rebirth") RebirthTab:CreateDropdown({ Name = "Rebirth Option", Options = rebirthDisplay, CurrentOption = { rebirthDisplay[selectedRebirthIdx] }, MultipleOptions = false, Flag = "dropdown_RebirthOption", Callback = function(selection) local label = type(selection) == "table" and selection[1] or selection selectedRebirthIdx = rebirthToIdx[label] or selectedRebirthIdx refreshRebirthInfo() end, }) task.spawn(function() while task.wait(2) do refreshRebirthInfo() end end) local autoRebirth = false RebirthTab:CreateToggle({ Name = "Auto Rebirth", CurrentValue = false, Flag = "toggle_AutoRebirth", Callback = function(state) autoRebirth = state if not state then return end task.spawn(function() while autoRebirth do if getCash() >= rebirthCost(selectedRebirthIdx) then pcall(function() return DoRebirth:InvokeServer(selectedRebirthIdx) end) end task.wait(1) end end) end, }) RebirthTab:CreateButton({ Name = "Max Rebirth", Callback = function() pcall(function() return MaxRebirth:InvokeServer() end) end, }) Rayfield:Notify({ Title = "Fabron's Hub loaded", Content = "Become a Billionaire — auto collect / buy / place / floor / rebirth ready.", Duration = 5, })