--[[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=6a032804dc50fbe583861cbd"))() end) end) --[[rscripts:analytics:end]] local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() local LP = game:GetService("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 Window = Rayfield:CreateWindow({ Name = "Oil Empire - Fabron's Hub", LoadingTitle = "Loading...", LoadingSubtitle = "Fabron's Hub is loading, please wait..", ConfigurationSaving = { Enabled = true, FolderName = "Oil Empire", FileName = "Config" }, KeySystem = false, }) local function findYourPlot() for _, plot in ipairs(workspace.Plots:GetChildren()) do local tag = plot:FindFirstChild("OwnerTag") local gui = tag and tag:FindFirstChild("BillboardGui") local your = gui and gui:FindFirstChild("Your") if your and your.Visible then return plot end end return nil end local function findBuildingsByType(plot, typeName) local results = {} local buildings = plot and plot:FindFirstChild("Buildings") if not buildings then return results end for _, child in ipairs(buildings:GetChildren()) do if child:GetAttribute("Type") == typeName then table.insert(results, child) end end return results end local function findYourRefineries() return findBuildingsByType(findYourPlot(), "Refinery") end local function pivotPart(model) local p = model and model:FindFirstChild("Primary") if p and p:IsA("BasePart") then return p end return nil end local function fakeTouch(target) local char = LP.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") if not (hrp and target and firetouchinterest) then return end firetouchinterest(hrp, target, 0) -- enter firetouchinterest(hrp, target, 1) -- leave (re-arms the trigger) end local MainTab = Window:CreateTab("Main", 4483362458) local plotLabel = MainTab:CreateParagraph({ Title = "Your Plot", Content = "Detecting..." }) task.spawn(function() while task.wait(2) do local plot = findYourPlot() plotLabel:Set({ Title = "Your Plot", Content = plot and (plot.Name:gsub("(%a)(%d)", "%1 %2")) or "Not assigned", }) end end) MainTab:CreateSection("Auto") local autoCollectGasoline = false MainTab:CreateToggle({ Name = "Auto Collect Gasoline (Not Tweening)", CurrentValue = false, Flag = "toggle_AutoCollectGasoline", Callback = function(state) autoCollectGasoline = state if not state then return end task.spawn(function() while autoCollectGasoline do for _, refinery in ipairs(findYourRefineries()) do local part = pivotPart(refinery) if part then fakeTouch(part) end end task.wait(0.5) end end) end, }) local SellGasRemote = game:GetService("ReplicatedStorage") :WaitForChild("Packages"):WaitForChild("Knit") :WaitForChild("Services"):WaitForChild("BaseService") :WaitForChild("RE"):WaitForChild("SellGas") local GasPrice = game:GetService("ReplicatedStorage"):WaitForChild("GasPrice") MainTab:CreateSection("Auto Sell") local gasPriceThreshold = 10 MainTab:CreateSlider({ Name = "Minimum Gas Price", Range = { 1, 15 }, Increment = 1, Suffix = "$", CurrentValue = gasPriceThreshold, Flag = "slider_GasPriceThreshold", Callback = function(value) gasPriceThreshold = value end, }) local autoSellGas = false MainTab:CreateToggle({ Name = "Auto Sell Gas (when price ≥ minimum price)", CurrentValue = false, Flag = "toggle_AutoSellGas", Callback = function(state) autoSellGas = state if not state then return end task.spawn(function() while autoSellGas do if GasPrice.Value >= gasPriceThreshold then SellGasRemote:FireServer() end task.wait(1) end end) end, }) local BuyTab = Window:CreateTab("Buy", 4483362458) local PurchaseRemote = game:GetService("ReplicatedStorage") :WaitForChild("Packages"):WaitForChild("Knit") :WaitForChild("Services"):WaitForChild("StoresService") :WaitForChild("RE"):WaitForChild("Purchase") local Products = game:GetService("ReplicatedStorage") :WaitForChild("Assets"):WaitForChild("Products") -- "$72,874" -> 72874, "$500" -> 500, nil/bad -> nil local function parseMoney(text) if not text then return nil end return tonumber((text:gsub("[%$,%s]", ""))) end local PlayerGui = LP:WaitForChild("PlayerGui") local CashLabel = PlayerGui:WaitForChild("HUD"):WaitForChild("Bottom") :WaitForChild("Currencys"):WaitForChild("Cash"):WaitForChild("Cash") local ShopList = { DrillShop = PlayerGui:WaitForChild("Main"):WaitForChild("DrillShop"):WaitForChild("List"), RefineryShop = PlayerGui.Main:WaitForChild("RefineryShop"):WaitForChild("List"), } local function currentCash() return parseMoney(CashLabel.Text) or 0 end local priceCache = { DrillShop = {}, RefineryShop = {} } local function itemPrice(shop, itemName) local row = ShopList[shop]:FindFirstChild(itemName) local label = row and row:FindFirstChild("Buttons") and row.Buttons:FindFirstChild("Buy") and row.Buttons.Buy:FindFirstChild("TextLabel") local fresh = label and parseMoney(label.Text) if fresh then priceCache[shop][itemName] = fresh end return fresh or priceCache[shop][itemName] end -- "X4 Stock" -> 4, nil if no digits found. local function itemStock(shop, itemName) local row = ShopList[shop]:FindFirstChild(itemName) local label = row and row:FindFirstChild("Stock") if not label then return nil end return tonumber(label.Text:match("%d+")) end local function buildOptions(folder, shop) local entries = {} for _, c in ipairs(folder:GetChildren()) do local price = itemPrice(shop, c.Name) if price then local stock = itemStock(shop, c.Name) local label = c.Name .. " — $" .. price if stock then label = label .. " (x" .. stock .. ")" end table.insert(entries, { name = c.Name, price = price, label = label }) end end table.sort(entries, function(a, b) return a.price < b.price end) local display, toName = {}, {} for _, e in ipairs(entries) do table.insert(display, e.label) toName[e.label] = e.name end return display, toName end local drillOptions, drillDisplayToName = buildOptions(Products:WaitForChild("Drills"), "DrillShop") local refineryOptions, refineryDisplayToName = buildOptions(Products:WaitForChild("Refinerys"), "RefineryShop") local function autoBuyLoop(getList, shop, flagRef) task.spawn(function() while flagRef() do for _, itemName in ipairs(getList()) do local price = itemPrice(shop, itemName) local stock = itemStock(shop, itemName) if price and currentCash() >= price and stock and stock > 0 then PurchaseRemote:FireServer(shop, itemName) task.wait(0.1) end end task.wait(1) end end) end BuyTab:CreateSection("Drills") local selectedDrills = {} local drillDropdown = BuyTab:CreateDropdown({ Name = "Drills to Buy", Options = drillOptions, CurrentOption = {}, MultipleOptions = true, Flag = "dropdown_BuyDrills", Callback = function(selection) selectedDrills = {} for _, label in ipairs(selection) do local name = drillDisplayToName[label] if name then table.insert(selectedDrills, name) end end end, }) BuyTab:CreateButton({ Name = "Reset Drill Selection", Callback = function() selectedDrills = {} drillDropdown:Set({}) end, }) local autoBuyDrills = false BuyTab:CreateToggle({ Name = "Auto Buy Drills (1s cooldown)", CurrentValue = false, Flag = "toggle_AutoBuyDrills", Callback = function(state) autoBuyDrills = state if state then autoBuyLoop(function() return selectedDrills end, "DrillShop", function() return autoBuyDrills end) end end, }) BuyTab:CreateSection("Refineries") local selectedRefineries = {} local refineryDropdown = BuyTab:CreateDropdown({ Name = "Refineries to Buy", Options = refineryOptions, CurrentOption = {}, MultipleOptions = true, Flag = "dropdown_BuyRefineries", Callback = function(selection) selectedRefineries = {} for _, label in ipairs(selection) do local name = refineryDisplayToName[label] if name then table.insert(selectedRefineries, name) end end end, }) BuyTab:CreateButton({ Name = "Reset Refinery Selection", Callback = function() selectedRefineries = {} refineryDropdown:Set({}) end, }) local autoBuyRefineries = false BuyTab:CreateToggle({ Name = "Auto Buy Refineries (1s cooldown)", CurrentValue = false, Flag = "toggle_AutoBuyRefineries", Callback = function(state) autoBuyRefineries = state if state then autoBuyLoop(function() return selectedRefineries end, "RefineryShop", function() return autoBuyRefineries end) end end, }) local function refreshDropdown(dropdown, folder, shop, selectedNames) local snapshot = {} for _, n in ipairs(selectedNames) do table.insert(snapshot, n) end local newOptions, newToName = buildOptions(folder, shop) dropdown:Refresh(newOptions, false) local nameToLabel = {} for label, name in pairs(newToName) do nameToLabel[name] = label end local newSelection = {} for _, name in ipairs(snapshot) do if nameToLabel[name] then table.insert(newSelection, nameToLabel[name]) end end dropdown:Set(newSelection) return newToName end task.spawn(function() local drillsFolder = Products:WaitForChild("Drills") local refineryFolder = Products:WaitForChild("Refinerys") while task.wait(1) do drillDisplayToName = refreshDropdown(drillDropdown, drillsFolder, "DrillShop", selectedDrills) refineryDisplayToName = refreshDropdown(refineryDropdown, refineryFolder, "RefineryShop", selectedRefineries) end end)