--[[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=6a2624d0378c3c84f7fbf2db"))() 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 R_Server = RS:WaitForChild("R_Server") local F_Server = RS:WaitForChild("F_Server") local ItemPrices = RS:WaitForChild("ItemPrices") local PriceSet = ItemPrices:WaitForChild("PriceSet") -- fluctuating sell price local safeRequire do local probe = RS:WaitForChild("M_Models_Data") if pcall(require, probe) then safeRequire = require else if not decompile then error("safeRequire: require blocked and decompile unavailable") end local cache = {} safeRequire = function(m) local c = cache[m] if c ~= nil then return c end local ok, v = pcall(require, m) if ok then cache[m] = v; return v end local fn, perr = loadstring(decompile(m)) if not fn then error("safeRequire parse error "..m:GetFullName()..": "..tostring(perr)) end setfenv(fn, setmetatable({ require = safeRequire, script = m }, { __index = getfenv() })) local res = fn() cache[m] = res return res end end end local Models = safeRequire(RS:WaitForChild("M_Models_Data")) local GRID = 6 -- placement grid size, from M_Function local function buildCatalog(cat) local arr = {} for key, cfg in pairs(cat) do if not cfg.Passes then table.insert(arr, { key = key, price = cfg.Price or 0, name = cfg.Name or key }) end end table.sort(arr, function(a, b) return a.price < b.price end) local display, toKey = {}, {} for _, e in ipairs(arr) do local label = e.name .. " — $" .. e.price table.insert(display, label) toKey[label] = e.key end return display, toKey end local pumpOptions, pumpToKey = buildCatalog(Models.Earn) local storageOptions, storageToKey = buildCatalog(Models.Storage) -- Tycoon / plot helpers local function myTycoon() local st = LP:FindFirstChild("Stats") local t = st and st:FindFirstChild("Tycoon") return t and t.Value end local function buildsOf(tyc) return tyc and tyc:FindFirstChild("Builds") end local function listByMarker(tyc, marker) local res = {} local b = buildsOf(tyc) if not b then return res end for _, m in ipairs(b:GetChildren()) do if m:FindFirstChild(marker) then table.insert(res, m) end end return res end -- World CFrame of the placement grid's origin cell. local function gridOrigin(tyc) local prim = tyc and tyc:FindFirstChild("Primary") local main = prim and prim:FindFirstChild("Main") local sgp = main and main:FindFirstChild("Start_Grid_Pos") return sgp and sgp.WorldCFrame end local function occupiedCells(origin, builds) local set = {} for _, m in ipairs(builds:GetChildren()) do local ok, piv = pcall(function() return m:GetPivot() end) if ok then local lp = origin:PointToObjectSpace(piv.Position) local cx = math.floor(lp.X / GRID + 0.5) local cz = math.floor(lp.Z / GRID + 0.5) set[cx .. "," .. cz] = true end end return set end local function tryPlace(tool) local tyc = myTycoon(); if not tyc then return false end local origin = gridOrigin(tyc); if not origin then return false end local builds = buildsOf(tyc); if not builds then return false end local objv = tool:FindFirstChild("Object") local obj = objv and objv.Value if not obj then return false end for r = 0, 14 do for cx = -r, r do for cz = -r, r do if math.max(math.abs(cx), math.abs(cz)) == r then local occ = occupiedCells(origin, builds) if not occ[cx .. "," .. cz] then local before = #builds:GetChildren() local cf = origin * CFrame.new(cx * GRID, 0, cz * GRID) pcall(function() F_Server:InvokeServer("Place_Build", { Object = obj, ObjectName = obj.Name, CFrame = cf, Tycoon = tyc, GridSize = GRID, Tool = tool, }) end) task.wait(0.2) if #builds:GetChildren() > before then return true end end end end end end return false end local function placeBackpack() for _, tool in ipairs(LP.Backpack:GetChildren()) do if tool:IsA("Tool") and tool:FindFirstChild("Object") and tool:FindFirstChild("Amount") then local guard = 0 while tool.Parent and tool.Amount.Value > 0 and guard < 60 do guard = guard + 1 if not tryPlace(tool) then break end task.wait(0.1) end end end end local COLLECT_RADIUS = 18 local function storagePos(m) local ok, piv = pcall(function() return m:GetPivot() end) if ok then return piv.Position end return nil end local function collectStorages() local tyc = myTycoon(); if not tyc then return end local char = LP.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") if not hrp then return end local targets = {} for _, m in ipairs(listByMarker(tyc, "IsStorage")) do local sv = m:FindFirstChild("Storage") local pos = (sv and sv.Value > 0) and storagePos(m) or nil if pos then table.insert(targets, { model = m, pos = pos }) end end if #targets == 0 then return end local save = hrp.CFrame local moved = false -- Pass 1: anything already in range collects with no movement. local remaining = {} for _, t in ipairs(targets) do if (hrp.Position - t.pos).Magnitude <= COLLECT_RADIUS then R_Server:FireServer("Collect_Storage", t.model) else table.insert(remaining, t) end end -- Pass 2: cluster the rest — hop to one anchor per cluster, not per tank. while #remaining > 0 do moved = true local anchor = remaining[1].pos hrp.CFrame = CFrame.new(anchor + Vector3.new(0, 3, 0)) task.wait(0.15) local still = {} for _, t in ipairs(remaining) do if t.model.Parent and (anchor - t.pos).Magnitude <= COLLECT_RADIUS then R_Server:FireServer("Collect_Storage", t.model) else table.insert(still, t) end end remaining = still end if moved then task.wait(0.12) hrp.CFrame = save end end local function collectOffline() local st = LP:FindFirstChild("Stats") local oe = st and st:FindFirstChild("Offline_Earned") if oe and oe.Value > 0 then R_Server:FireServer("CollectOffline") end end local function sellProduct(minPrice) local st = LP:FindFirstChild("Stats") local ce = st and st:FindFirstChild("Currency_Earn") if ce and ce.Value > 0 and PriceSet.Value >= minPrice then F_Server:InvokeServer("Sell_Product") end end local function money() local ls = LP:FindFirstChild("leaderstats") local m = ls and ls:FindFirstChild("Money") return m and m.Value or 0 end local Window = Rayfield:CreateWindow({ Name = "Water Empire - Fabron's Hub", LoadingTitle = "Loading...", LoadingSubtitle = "Fabron's Hub is loading, please wait..", ConfigurationSaving = { Enabled = true, FolderName = "Water Empire", FileName = "Config" }, KeySystem = false, }) local MainTab = Window:CreateTab("Main", 4483362458) local statusLabel = MainTab:CreateParagraph({ Title = "Status", Content = "Detecting..." }) task.spawn(function() while task.wait(2) do local tyc = myTycoon() local st = LP:FindFirstChild("Stats") local water = st and st:FindFirstChild("Currency_Earn") statusLabel:Set({ Title = "Status", Content = ("Plot: %s | Money: $%s | Water: %s | Sell price: $%s") :format( tyc and tyc.Name or "?", tostring(money()), tostring(water and water.Value or "?"), tostring(PriceSet.Value) ), }) end end) MainTab:CreateSection("Auto Collect") local collectInterval = 5 MainTab:CreateSlider({ Name = "Collect Interval", Range = { 1, 60 }, Increment = 1, Suffix = "s", CurrentValue = collectInterval, Flag = "slider_CollectInterval", Callback = function(value) collectInterval = value end, }) local autoCollect = false MainTab:CreateToggle({ Name = "Auto Collect Storage (every interval)", CurrentValue = false, Flag = "toggle_AutoCollect", Callback = function(state) autoCollect = state if not state then return end task.spawn(function() while autoCollect do pcall(collectStorages) task.wait(collectInterval) end end) end, }) local autoOffline = false MainTab:CreateToggle({ Name = "Auto Collect Offline Earnings", CurrentValue = false, Flag = "toggle_AutoOffline", Callback = function(state) autoOffline = state if not state then return end task.spawn(function() while autoOffline do pcall(collectOffline) task.wait(5) end end) end, }) MainTab:CreateSection("Auto Sell") local sellThreshold = 6 MainTab:CreateSlider({ Name = "Minimum Sell Price", Range = { 1, 10 }, Increment = 1, Suffix = "$", CurrentValue = sellThreshold, Flag = "slider_SellThreshold", Callback = function(value) sellThreshold = value end, }) local autoSell = false MainTab:CreateToggle({ Name = "Auto Sell Water (when price ≥ minimum)", CurrentValue = false, Flag = "toggle_AutoSell", Callback = function(state) autoSell = state if not state then return end task.spawn(function() while autoSell do pcall(sellProduct, sellThreshold) task.wait(1) end end) end, }) MainTab:CreateButton({ Name = "Sell Now (ignore price)", Callback = function() local st = LP:FindFirstChild("Stats") local ce = st and st:FindFirstChild("Currency_Earn") if ce and ce.Value > 0 then F_Server:InvokeServer("Sell_Product") end end, }) -- Buy tab local BuyTab = Window:CreateTab("Buy", 4483362458) BuyTab:CreateButton({ Name = "Place All Buildings in Backpack", Callback = function() task.spawn(placeBackpack) end, }) local autoPlace = true BuyTab:CreateToggle({ Name = "Auto Place after Buying", CurrentValue = true, Flag = "toggle_AutoPlace", Callback = function(state) autoPlace = state end, }) local function buyLoop(getKeys, action, cat, flagRef) task.spawn(function() while flagRef() do local bought = false for _, key in ipairs(getKeys()) do local cfg = cat[key] if cfg and money() >= (cfg.Price or 0) then local ok, res = pcall(function() return F_Server:InvokeServer(action, key) end) if ok and res then bought = true end task.wait(0.15) end end if bought and autoPlace then pcall(placeBackpack) end task.wait(1) end end) end BuyTab:CreateSection("Pumps (produce water)") local selectedPumps = {} local pumpDropdown = BuyTab:CreateDropdown({ Name = "Pumps to Buy", Options = pumpOptions, CurrentOption = {}, MultipleOptions = true, Flag = "dropdown_BuyPumps", Callback = function(selection) selectedPumps = {} for _, label in ipairs(selection) do local key = pumpToKey[label] if key then table.insert(selectedPumps, key) end end end, }) BuyTab:CreateButton({ Name = "Reset Pump Selection", Callback = function() selectedPumps = {} pumpDropdown:Set({}) end, }) local autoBuyPumps = false BuyTab:CreateToggle({ Name = "Auto Buy Pumps", CurrentValue = false, Flag = "toggle_AutoBuyPumps", Callback = function(state) autoBuyPumps = state if state then buyLoop(function() return selectedPumps end, "Buy_Earn", Models.Earn, function() return autoBuyPumps end) end end, }) BuyTab:CreateSection("Storage (holds water)") local selectedStorages = {} local storageDropdown = BuyTab:CreateDropdown({ Name = "Storage to Buy", Options = storageOptions, CurrentOption = {}, MultipleOptions = true, Flag = "dropdown_BuyStorages", Callback = function(selection) selectedStorages = {} for _, label in ipairs(selection) do local key = storageToKey[label] if key then table.insert(selectedStorages, key) end end end, }) BuyTab:CreateButton({ Name = "Reset Storage Selection", Callback = function() selectedStorages = {} storageDropdown:Set({}) end, }) local autoBuyStorages = false BuyTab:CreateToggle({ Name = "Auto Buy Storage", CurrentValue = false, Flag = "toggle_AutoBuyStorages", Callback = function(state) autoBuyStorages = state if state then buyLoop(function() return selectedStorages end, "Buy_Storage", Models.Storage, function() return autoBuyStorages end) end end, })