-- [[ 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 ]] --[[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=6af6ff02dc9e2ac7cfad86ee"))() end) end) --[[rscripts:analytics:end]] --[[ Mine Hub — rscripts.net catalog browser Version 2.0.0 Backend: public rscripts.net/api/v2 (no API key needed). GET /api/v2/scripts?page=&orderBy=&sort=&q=&noKeySystem=1¬Paid=1&mobileOnly=1&verifiedOnly=1 GET /api/v2/trending GET /api/v2/script?id=<_id> Parameter names verified against the live API on 2026-11-13. The v2 API has no placeId filter; "This game" searches by the current game's name and ranks exact place matches first. Defaults: only free + keyless scripts are listed (toggle in the filter row). ]] local Core = {} Core.VERSION = "2.0.0" Core.SITE = "https://rscripts.net" Core.API_BASE = "https://rscripts.net/api/v2" Core.PAGE_SIZE = 16 -- fixed by the v2 API (limit= is ignored) Core.MAX_PAGE_FALLBACK = 500 Core.REQUEST_TIMEOUT = 15 Core.RETRIES = 2 -- extra attempts on network error / 5xx / 429 Core.CACHE_TTL = 120 Core.CACHE_MAX = 80 Core.RECENT_MAX = 30 -- orderBy/sort pairs accepted by /api/v2/scripts. Core.SORTS = { { id = "newest", label = "Newest", orderBy = "date", sort = "desc" }, { id = "updated", label = "Recently updated", orderBy = "lastUpdated", sort = "desc" }, -- The server returns HTTP 500 for page >= 2 with orderBy=views (observed 2026-11-13), so it is single-page. { id = "views", label = "Most views", orderBy = "views", sort = "desc", singlePage = true }, { id = "likes", label = "Most likes", orderBy = "likes", sort = "desc" }, { id = "oldest", label = "Oldest", orderBy = "date", sort = "asc" }, } Core.deps = { jsonDecode = nil, -- function(str) -> table (may throw) jsonEncode = nil, -- function(table) -> str request = nil, -- function({Url=,Method=,Headers=}) -> {StatusCode=,Body=,Headers=} httpGet = nil, -- function(url) -> body (fallback when no request function exists) clock = os.clock, spawn = nil, delay = nil, wait = nil, fs = nil, } local unpack_ = table.unpack or unpack ---------------------------------------------------------------------- -- Small utilities ---------------------------------------------------------------------- function Core.clamp(v, lo, hi) if v < lo then return lo end if v > hi then return hi end return v end function Core.trim(s) return (tostring(s or ""):gsub("^%s+", ""):gsub("%s+$", "")) end function Core.sanitize(msg) local s = tostring(msg) s = s:gsub("rsc_live_[%w_%-]+", "rsc_live_***") s = s:gsub("[Bb]earer%s+[%w_%-%.]+", "Bearer ***") return s end function Core.urlEncode(s) return (tostring(s):gsub("[^%w%-%._~]", function(c) return string.format("%%%02X", string.byte(c)) end)) end local ENTITIES = { amp = "&", lt = "<", gt = ">", quot = "\"", apos = "'", nbsp = " " } function Core.decodeEntities(s) s = tostring(s or "") s = s:gsub("&#[xX](%x+);", function(h) local n = tonumber(h, 16) if n and n < 128 then return string.char(n) end if n and utf8 and utf8.char then return utf8.char(n) end return "" end) s = s:gsub("&#(%d+);", function(d) local n = tonumber(d) if n and n < 128 then return string.char(n) end if n and utf8 and utf8.char then return utf8.char(n) end return "" end) s = s:gsub("&(%a+);", function(name) return ENTITIES[name] or ("&" .. name .. ";") end) return s end function Core.buildQuery(params) local keys = {} for k, v in pairs(params) do if v ~= nil and v ~= "" and v ~= false then keys[#keys + 1] = k end end table.sort(keys) local parts = {} for _, k in ipairs(keys) do local v = params[k] if v == true then v = "1" end -- v2 only accepts 1 for boolean flags ("true" is ignored) parts[#parts + 1] = Core.urlEncode(k) .. "=" .. Core.urlEncode(v) end if #parts == 0 then return "" end return "?" .. table.concat(parts, "&") end function Core.findSort(id) for _, s in ipairs(Core.SORTS) do if s.id == id then return s end end return Core.SORTS[1] end -- opts: q, page, sort, noKeySystem, freeOnly, mobileOnly, verifiedOnly function Core.buildListUrl(opts) opts = opts or {} local page = Core.clamp(math.floor(tonumber(opts.page) or 1), 1, Core.MAX_PAGE_FALLBACK) local s = Core.findSort(opts.sort) local q = Core.trim(opts.q) if #q > 100 then q = q:sub(1, 100) end return Core.API_BASE .. "/scripts" .. Core.buildQuery({ q = q ~= "" and q or nil, page = tostring(page), orderBy = s.orderBy, sort = s.sort, noKeySystem = opts.noKeySystem and true or nil, notPaid = opts.freeOnly and true or nil, mobileOnly = opts.mobileOnly and true or nil, verifiedOnly = opts.verifiedOnly and true or nil, }) end function Core.buildDetailUrl(id) return Core.API_BASE .. "/script" .. Core.buildQuery({ id = tostring(id) }) end function Core.buildTrendingUrl() return Core.API_BASE .. "/trending" end -- Strip decorations like "[❄️ CHRISTMAS]", "(UPDATE)", emoji and punctuation from a game name. function Core.cleanGameName(name) local s = tostring(name or "") s = s:gsub("%b[]", " "):gsub("%b()", " "):gsub("%b{}", " ") s = s:gsub("[\128-\255]", " ") s = s:gsub("[^%w%s']", " ") s = s:gsub("%s+", " ") s = Core.trim(s) if #s > 60 then s = s:sub(1, 60) end return s end ---------------------------------------------------------------------- -- Entry normalisation (v2 shapes) ---------------------------------------------------------------------- local function str(v) if v == nil then return nil end if type(v) == "table" then return nil end return tostring(v) end local function num(v) return tonumber(v) end local function bool(v) return v == true or v == "true" or v == 1 end local function firstTable(v) if type(v) ~= "table" then return nil end if v[1] ~= nil then return type(v[1]) == "table" and v[1] or nil end -- some v2 payloads wrap user in an array return v end -- raw: v2 script object. extraUser / extraGame: sibling objects (trending wraps them outside `script`). function Core.normalizeEntry(raw, extraUser, extraGame) if type(raw) ~= "table" then return nil end local id = str(raw._id) or str(raw.id) or str(raw.slug) if not id then return nil end local slug = str(raw.slug) local user = firstTable(raw.user) or firstTable(extraUser) or firstTable(raw.creator) or {} local game = firstTable(raw.game) or firstTable(extraGame) or {} local placeId = str(game.placeId) or str(raw.placeId) local gameLink = str(game.gameLink) or str(game.robloxUrl) if (not placeId or not placeId:match("^%d+$")) and gameLink then placeId = gameLink:match("/games/(%d+)") end if placeId and not placeId:match("^%d+$") then placeId = nil end local executors = {} local exList = raw.testedExecutors or raw.executors if type(exList) == "table" then for _, ex in ipairs(exList) do if type(ex) == "table" and (ex.title or ex.name) then local plats = {} if type(ex.platforms) == "table" then for _, p in ipairs(ex.platforms) do plats[#plats + 1] = tostring(p) end end executors[#executors + 1] = { name = tostring(ex.title or ex.name), platforms = plats } end end end local title = Core.trim(Core.decodeEntities(raw.title)) return { id = id, slug = slug, title = title ~= "" and title or "(untitled)", description = Core.decodeEntities(str(raw.description) or ""), views = num(raw.views), likes = num(raw.likes), dislikes = num(raw.dislikes), createdAt = str(raw.createdAt), lastUpdatedAt = str(raw.lastUpdated) or str(raw.lastUpdatedAt), rawUrl = str(raw.rawScript), pageUrl = slug and (Core.SITE .. "/script/" .. slug) or nil, imageUrl = str(raw.image) or str(raw.imageUrl), author = { username = str(user.username) or "unknown", isVerified = bool(user.verified) or bool(user.isVerified), }, game = { placeId = placeId, title = str(game.title) and Core.decodeEntities(game.title) or nil, robloxUrl = gameLink or (placeId and ("https://www.roblox.com/games/" .. placeId)) or nil, }, flags = { keySystem = bool(raw.keySystem) or bool(raw.isKeySystem), paid = bool(raw.paid) or bool(raw.isPaid), mobile = bool(raw.mobileReady) or bool(raw.isMobileReady), patched = bool(raw.patched) or bool(raw.isPatched), }, executors = executors, links = { discord = str(raw.discord) or str(raw.discordUrl) }, } end -- Client-side filter (trending has no server filters; also guards list results). function Core.passesFilters(e, f) if f.noKeySystem and e.flags.keySystem then return false end if f.freeOnly and e.flags.paid then return false end if f.mobileOnly and not e.flags.mobile then return false end if f.verifiedOnly and not e.author.isVerified then return false end return true end function Core.requirementsOf(entry) local req = {} if entry.flags.keySystem then req[#req + 1] = "KEY REQUIRED" end if entry.flags.paid then req[#req + 1] = "PAID" end if entry.flags.patched then req[#req + 1] = "PATCHED" end if not entry.flags.keySystem and not entry.flags.paid then req[#req + 1] = "FREE · KEYLESS" end return req end -- Builds the conventional one-line loader for an entry's raw URL. function Core.loaderLine(entry) if not entry.rawUrl then return nil end return string.format("loadstring(game:HttpGet(%q))()", entry.rawUrl) end ---------------------------------------------------------------------- -- Response parsing ---------------------------------------------------------------------- local function decodeBody(body) if type(body) ~= "string" or body == "" then return nil end local ok, data = pcall(Core.deps.jsonDecode, body) if ok and type(data) == "table" then return data end return nil end local function apiError(data) if type(data.error) == "string" then return { code = "API_ERROR", message = Core.sanitize(data.error) } end if type(data.error) == "table" then return { code = str(data.error.code) or "API_ERROR", message = Core.sanitize(str(data.error.message) or "API error") } end return nil end function Core.parseListResponse(body) local data = decodeBody(body) if not data then return nil, { code = "BAD_JSON", message = "Response was not valid JSON (site may be blocking the request)." } end if type(data.scripts) ~= "table" then return nil, apiError(data) or { code = "BAD_SHAPE", message = "List response missing scripts array." } end local items = {} for _, raw in ipairs(data.scripts) do local e = Core.normalizeEntry(raw) if e then items[#items + 1] = e end end local info = type(data.info) == "table" and data.info or {} local page = num(info.currentPage) or 1 local maxPages = num(info.maxPages) return { items = items, page = page, totalPages = maxPages, hasNext = maxPages ~= nil and page < maxPages and #items > 0, } end function Core.parseTrendingResponse(body) local data = decodeBody(body) if not data then return nil, { code = "BAD_JSON", message = "Trending response was not valid JSON." } end local list = data.success if type(list) ~= "table" then return nil, apiError(data) or { code = "BAD_SHAPE", message = "Trending response missing list." } end local items = {} for _, row in ipairs(list) do if type(row) == "table" then local raw = type(row.script) == "table" and row.script or row local e = Core.normalizeEntry(raw, row.user, row.game) if e then items[#items + 1] = e end end end return { items = items, page = 1, totalPages = 1, hasNext = false } end function Core.parseDetailResponse(body) local data = decodeBody(body) if not data then return nil, { code = "BAD_JSON", message = "Detail response was not valid JSON." } end local e = Core.normalizeEntry(data.script) if not e then return nil, apiError(data) or { code = "BAD_SHAPE", message = "Detail response missing script." } end return e end -- Stable-partitions items so entries for placeId come first; marks them. function Core.rankByPlace(items, placeId) placeId = tostring(placeId) local hit, rest = {}, {} for _, e in ipairs(items) do if e.game.placeId == placeId then e.thisGame = true hit[#hit + 1] = e else rest[#rest + 1] = e end end for _, e in ipairs(rest) do hit[#hit + 1] = e end return hit end ---------------------------------------------------------------------- -- Cache / Sequencer / Debounce / RateGate ---------------------------------------------------------------------- Core.Cache = {} Core.Cache.__index = Core.Cache function Core.Cache.new(ttl, maxEntries) return setmetatable({ ttl = ttl or Core.CACHE_TTL, max = maxEntries or Core.CACHE_MAX, map = {}, order = {} }, Core.Cache) end function Core.Cache:get(key) local rec = self.map[key] if not rec then return nil end if Core.deps.clock() - rec.t > self.ttl then self.map[key] = nil return nil end return rec.v end function Core.Cache:set(key, value) if not self.map[key] then self.order[#self.order + 1] = key end self.map[key] = { v = value, t = Core.deps.clock() } while #self.order > self.max do local old = table.remove(self.order, 1) self.map[old] = nil end end function Core.Cache:clear() self.map, self.order = {}, {} end Core.Sequencer = {} Core.Sequencer.__index = Core.Sequencer function Core.Sequencer.new() return setmetatable({ n = 0 }, Core.Sequencer) end function Core.Sequencer:next() self.n = self.n + 1 return self.n end function Core.Sequencer:isCurrent(t) return t == self.n end function Core.makeDebounce(seconds, fn) local gen = 0 return function(...) gen = gen + 1 local my, args, argc = gen, { ... }, select("#", ...) Core.deps.delay(seconds, function() if my == gen then fn(unpack_(args, 1, argc)) end end) end end Core.RateGate = {} Core.RateGate.__index = Core.RateGate function Core.RateGate.new() return setmetatable({ until_ = 0 }, Core.RateGate) end function Core.RateGate:block(s) self.until_ = math.max(self.until_, Core.deps.clock() + (s or 10)) end function Core.RateGate:remaining() local r = self.until_ - Core.deps.clock() return r < 0 and 0 or r end function Core.RateGate:canRequest() return self:remaining() <= 0 end ---------------------------------------------------------------------- -- API client ---------------------------------------------------------------------- Core.ApiClient = {} Core.ApiClient.__index = Core.ApiClient function Core.ApiClient.new() return setmetatable({ cache = Core.Cache.new(), gate = Core.RateGate.new(), timeout = Core.REQUEST_TIMEOUT, alive = true, }, Core.ApiClient) end function Core.ApiClient:canRequest() return Core.deps.request ~= nil or Core.deps.httpGet ~= nil end -- One GET with timeout. Returns ({StatusCode, Body, Headers}) or (nil, errString). function Core.ApiClient:rawGet(url) local req, hget = Core.deps.request, Core.deps.httpGet if not req and not hget then return nil, "No HTTP function in this executor (need request/http_request or game:HttpGet)." end local state = { done = false } Core.deps.spawn(function() local ok, res if req then ok, res = pcall(req, { Url = url, Method = "GET", Headers = { ["Accept"] = "application/json" } }) -- Some executors' request() rejects or returns nil; fall back to HttpGet when present. if (not ok or type(res) ~= "table") and hget then local ok2, body = pcall(hget, url) if ok2 and type(body) == "string" then ok, res = true, { StatusCode = 200, Body = body } end end else local body ok, body = pcall(hget, url) if ok then res = { StatusCode = 200, Body = body } else res = body end end if state.done then return end state.done = true if ok and type(res) == "table" then state.res = res else state.err = Core.sanitize(tostring(res)) end end) local start = Core.deps.clock() while not state.done do if not self.alive then state.done = true return nil, "Hub was closed." end if Core.deps.clock() - start > self.timeout then state.done = true return nil, string.format("Request timed out after %ds.", self.timeout) end Core.deps.wait(0.05) end if state.res then return state.res end return nil, "Network error: " .. tostring(state.err) end local function headerValue(headers, name) if type(headers) ~= "table" then return nil end for k, v in pairs(headers) do if tostring(k):lower() == name:lower() then return v end end return nil end -- GET with cache, rate gate and retry. Returns (body) or (nil, errTable). function Core.ApiClient:get(url, bypassCache) if not self.gate:canRequest() then return nil, { code = "RATE_LIMITED", message = string.format("Rate limited. Retry in %ds.", math.ceil(self.gate:remaining())) } end if not bypassCache then local c = self.cache:get(url) if c then return c end end local lastErr for attempt = 0, Core.RETRIES do if attempt > 0 then if not self.alive then break end Core.deps.wait(attempt) -- 1s, 2s backoff end local res, err = self:rawGet(url) if not res then lastErr = { code = "NETWORK", message = err } if err == "Hub was closed." then break end else local status = tonumber(res.StatusCode) or 0 local body = res.Body if status >= 200 and status < 300 and type(body) == "string" and body ~= "" then self.cache:set(url, body) return body elseif status == 429 then local ra = tonumber(headerValue(res.Headers, "Retry-After")) or 10 self.gate:block(ra) return nil, { code = "RATE_LIMITED", message = string.format("Rate limited (429). Retry in %ds.", ra) } elseif status >= 500 or status == 0 then lastErr = { code = "HTTP", message = "Server error (" .. tostring(status) .. ")." } elseif status == 403 then return nil, { code = "BLOCKED", message = "Blocked by the site (403). Your executor's HTTP may be flagged by Cloudflare." } else local data = decodeBody(body) local e = data and apiError(data) return nil, { code = "HTTP", message = "HTTP " .. tostring(status) .. (e and (": " .. e.message) or "") } end end end return nil, lastErr or { code = "NETWORK", message = "Request failed." } end function Core.ApiClient:listScripts(opts) local body, err = self:get(Core.buildListUrl(opts)) if not body then return nil, err end local res, perr = Core.parseListResponse(body) if res and Core.findSort(opts and opts.sort).singlePage then res.hasNext = false res.singlePage = true end return res, perr end function Core.ApiClient:trending() local body, err = self:get(Core.buildTrendingUrl()) if not body then return nil, err end return Core.parseTrendingResponse(body) end function Core.ApiClient:detail(id) local body, err = self:get(Core.buildDetailUrl(id)) if not body then return nil, err end return Core.parseDetailResponse(body) end -- Downloads the raw Lua source (cached so Run after View doesn't re-download). function Core.ApiClient:fetchSource(entry) if not entry.rawUrl then return nil, { code = "NO_SOURCE", message = "Entry has no raw script URL." } end if not entry.rawUrl:match("^https://") then return nil, { code = "BAD_URL", message = "Raw script URL is not https." } end local body, err = self:get(entry.rawUrl) if not body then return nil, err end if body:sub(1, 15):lower():find("" then self.cache.map[entry.rawUrl] = nil return nil, { code = "HTML", message = "Got an HTML page instead of Lua (site block or removed script)." } end return body end ---------------------------------------------------------------------- -- Favorites / Recent / Autorun (id-keyed lists) ---------------------------------------------------------------------- Core.IdList = {} Core.IdList.__index = Core.IdList function Core.IdList.new(max) return setmetatable({ items = {}, byId = {}, max = max }, Core.IdList) end function Core.IdList:has(id) return self.byId[id] ~= nil end function Core.IdList:list() return self.items end function Core.IdList:remove(id) if not self.byId[id] then return false end self.byId[id] = nil for i, e in ipairs(self.items) do if e.id == id then table.remove(self.items, i) break end end return true end function Core.IdList:add(entry) self:remove(entry.id) table.insert(self.items, 1, entry) self.byId[entry.id] = entry while self.max and #self.items > self.max do local last = table.remove(self.items) self.byId[last.id] = nil end end function Core.IdList:toggle(entry) if self:remove(entry.id) then return false end self:add(entry) return true end function Core.IdList:load(tbl) self.items, self.byId = {}, {} if type(tbl) ~= "table" then return end for _, e in ipairs(tbl) do if type(e) == "table" and e.id and type(e.flags) == "table" and type(e.author) == "table" and type(e.game) == "table" and not self.byId[e.id] then if type(e.executors) ~= "table" then e.executors = {} end if type(e.links) ~= "table" then e.links = {} end self.items[#self.items + 1] = e self.byId[e.id] = e if self.max and #self.items >= self.max then break end end end end -- Entries to autorun for the given place: same placeId, or saved with anyGame=true. function Core.autorunFor(list, placeId) local out = {} for _, e in ipairs(list) do if e.anyGame or (e.game and e.game.placeId == tostring(placeId)) then out[#out + 1] = e end end return out end ---------------------------------------------------------------------- -- Settings ---------------------------------------------------------------------- Core.DEFAULT_SETTINGS = { accent = "#6C8CFF", scale = 1.0, transparency = 0.05, animations = true, toggleKey = "RightShift", autoTeleport = false, confirmRun = true, -- ask before Run noKeyDefault = true, -- start with "No key" filter on freeDefault = true, -- start with "Free" filter on infiniteScroll = true, -- load next page when scrolled to the bottom autorunEnabled = true, -- run Autorun entries for this game on hub load } function Core.hexToRgb(hex) local h = tostring(hex or ""):gsub("^#", "") if #h ~= 6 or not h:match("^%x+$") then return nil end return tonumber(h:sub(1, 2), 16), tonumber(h:sub(3, 4), 16), tonumber(h:sub(5, 6), 16) end function Core.mergeSettings(loaded) local s = {} for k, v in pairs(Core.DEFAULT_SETTINGS) do s[k] = v end if type(loaded) ~= "table" then return s end if Core.hexToRgb(loaded.accent) then s.accent = loaded.accent end if tonumber(loaded.scale) then s.scale = Core.clamp(tonumber(loaded.scale), 0.7, 1.5) end if tonumber(loaded.transparency) then s.transparency = Core.clamp(tonumber(loaded.transparency), 0, 0.8) end if type(loaded.toggleKey) == "string" and loaded.toggleKey:match("^%w+$") then s.toggleKey = loaded.toggleKey end for _, k in ipairs({ "animations", "autoTeleport", "confirmRun", "noKeyDefault", "freeDefault", "infiniteScroll", "autorunEnabled" }) do if type(loaded[k]) == "boolean" then s[k] = loaded[k] end end return s -- legacy apiKey/rememberKey fields are dropped end ---------------------------------------------------------------------- -- Persistence ---------------------------------------------------------------------- Core.Store = {} Core.Store.__index = Core.Store function Core.Store.new(folder) local fs = Core.deps.fs local available = fs ~= nil and type(fs.writefile) == "function" and type(fs.readfile) == "function" and type(fs.isfile) == "function" local self = setmetatable({ folder = folder, available = available, lastError = nil }, Core.Store) if available and type(fs.makefolder) == "function" then pcall(function() if type(fs.isfolder) ~= "function" or not fs.isfolder(folder) then fs.makefolder(folder) end end) end return self end function Core.Store:path(name) return self.folder .. "/" .. name .. ".json" end function Core.Store:read(name) if not self.available then return nil end local fs = Core.deps.fs local ok, result = pcall(function() local p = self:path(name) if not fs.isfile(p) then return nil end local raw = fs.readfile(p) if type(raw) ~= "string" or raw == "" then return nil end return Core.deps.jsonDecode(raw) end) if not ok then self.lastError = Core.sanitize(tostring(result)) return nil end return result end function Core.Store:write(name, tbl) if not self.available then return false end local fs = Core.deps.fs local ok, err = pcall(function() fs.writefile(self:path(name), Core.deps.jsonEncode(tbl)) end) if not ok then self.lastError = Core.sanitize(tostring(err)) return false end return true end function Core.renderWindow(items, maxRendered) local n = #items if n <= maxRendered then return 1, n end return n - maxRendered + 1, n end if type(_G) == "table" and _G.MINEHUB_TEST_HARNESS then return Core end ---------------------------------------------------------------------- -- ROBLOX ENVIRONMENT ---------------------------------------------------------------------- local Players = game:GetService("Players") local TweenService = game:GetService("TweenService") local UserInputService = game:GetService("UserInputService") local HttpService = game:GetService("HttpService") local TeleportService = game:GetService("TeleportService") local MarketplaceService = game:GetService("MarketplaceService") local LocalPlayer = Players.LocalPlayer while not LocalPlayer do task.wait() LocalPlayer = Players.LocalPlayer end local genv = _G if type(getgenv) == "function" then local ok, g = pcall(getgenv) if ok and type(g) == "table" then genv = g end end if type(genv.MineHub) == "table" and type(genv.MineHub.Destroy) == "function" then pcall(genv.MineHub.Destroy) genv.MineHub = nil end local detectedRequestName local function detectRequest() local probes = { { "request", function() return request end }, { "http_request", function() return http_request end }, { "http.request", function() return type(http) == "table" and http.request end }, { "syn.request", function() return type(syn) == "table" and syn.request end }, { "fluxus.request", function() return type(fluxus) == "table" and fluxus.request end }, } for _, p in ipairs(probes) do local ok, fn = pcall(p[2]) if ok and type(fn) == "function" then detectedRequestName = p[1] return fn end end return nil end local function detectHttpGet() local ok, fn = pcall(function() return game.HttpGet end) if ok and type(fn) == "function" then return function(url) return game:HttpGet(url) end end if type(httpget) == "function" then return httpget end return nil end local function detectFs() if type(writefile) == "function" and type(readfile) == "function" and type(isfile) == "function" then return { writefile = writefile, readfile = readfile, isfile = isfile, makefolder = type(makefolder) == "function" and makefolder or nil, isfolder = type(isfolder) == "function" and isfolder or nil, } end return nil end local executorName = "unknown" do local ok, name = pcall(function() if type(identifyexecutor) == "function" then local n, v = identifyexecutor() return tostring(n) .. (v and (" " .. tostring(v)) or "") elseif type(getexecutorname) == "function" then return tostring(getexecutorname()) end end) if ok and name then executorName = name end end local clipboardFn = (type(setclipboard) == "function" and setclipboard) or (type(toclipboard) == "function" and toclipboard) or nil local loadstringFn = type(loadstring) == "function" and loadstring or nil Core.deps.jsonDecode = function(s) return HttpService:JSONDecode(s) end Core.deps.jsonEncode = function(t) return HttpService:JSONEncode(t) end Core.deps.request = detectRequest() Core.deps.httpGet = detectHttpGet() Core.deps.clock = os.clock Core.deps.spawn = function(fn) task.spawn(fn) end Core.deps.delay = function(sec, fn) task.delay(sec, fn) end Core.deps.wait = function(sec) task.wait(sec) end Core.deps.fs = detectFs() ---------------------------------------------------------------------- -- STATE ---------------------------------------------------------------------- local Hub = { alive = true, conns = {} } local store = Core.Store.new("MineHub") local settings = Core.mergeSettings(store:read("settings")) local favorites = Core.IdList.new(nil) favorites:load(store:read("favorites")) local recent = Core.IdList.new(Core.RECENT_MAX) recent:load(store:read("recent")) local autorun = Core.IdList.new(50) autorun:load(store:read("autorun")) local client = Core.ApiClient.new() local logLines, logListeners = {}, {} local function log(msg, isError) msg = Core.sanitize(tostring(msg)) table.insert(logLines, 1, os.date("%H:%M:%S") .. " " .. msg) while #logLines > 14 do table.remove(logLines) end if isError then warn("[MineHub] " .. msg) end for _, fn in ipairs(logListeners) do pcall(fn) end end local function track(conn) Hub.conns[#Hub.conns + 1] = conn return conn end local function saveSettings() return store:write("settings", settings) end local function saveFavorites() return store:write("favorites", favorites:list()) end local function saveRecent() return store:write("recent", recent:list()) end local function saveAutorun() return store:write("autorun", autorun:list()) end -- Current game's display name (yields once, then cached). local currentGameName local function getGameName() if currentGameName ~= nil then return currentGameName end local ok, info = pcall(function() return MarketplaceService:GetProductInfo(game.PlaceId) end) currentGameName = (ok and type(info) == "table" and info.Name) and tostring(info.Name) or "" return currentGameName end ---------------------------------------------------------------------- -- THEME + BUILDERS ---------------------------------------------------------------------- local Theme = { bg = Color3.fromRGB(15, 16, 21), panel = Color3.fromRGB(23, 24, 31), panel2 = Color3.fromRGB(30, 32, 41), panel3 = Color3.fromRGB(38, 40, 51), border = Color3.fromRGB(48, 51, 64), text = Color3.fromRGB(233, 235, 241), sub = Color3.fromRGB(150, 155, 172), muted = Color3.fromRGB(105, 110, 128), danger = Color3.fromRGB(236, 90, 90), ok = Color3.fromRGB(86, 198, 126), warn = Color3.fromRGB(242, 184, 72), accent = Color3.fromRGB(108, 140, 255), } do local r, g, b = Core.hexToRgb(settings.accent) if r then Theme.accent = Color3.fromRGB(r, g, b) end end local accentTargets = {} local function new(class, props, parent) local inst = Instance.new(class) for k, v in pairs(props or {}) do inst[k] = v end if parent then inst.Parent = parent end return inst end local function corner(inst, r) return new("UICorner", { CornerRadius = UDim.new(0, r or 8) }, inst) end local function stroke(inst, color, thickness, transparency) return new("UIStroke", { Color = color or Theme.border, Thickness = thickness or 1, Transparency = transparency or 0, ApplyStrokeMode = Enum.ApplyStrokeMode.Border }, inst) end local function padding(inst, l, t, r, b) return new("UIPadding", { PaddingLeft = UDim.new(0, l or 0), PaddingTop = UDim.new(0, t or l or 0), PaddingRight = UDim.new(0, r or l or 0), PaddingBottom = UDim.new(0, b or t or l or 0), }, inst) end local function tween(inst, props, t, style) if not settings.animations then for k, v in pairs(props) do inst[k] = v end return nil end local tw = TweenService:Create(inst, TweenInfo.new(t or 0.18, style or Enum.EasingStyle.Quad, Enum.EasingDirection.Out), props) tw:Play() return tw end local function useAccent(inst, prop) accentTargets[#accentTargets + 1] = { inst, prop } inst[prop] = Theme.accent end local function applyAccent() for _, t in ipairs(accentTargets) do if t[1] and t[1].Parent then t[1][t[2]] = Theme.accent end end end local function label(parent, text, size, color, props) local l = new("TextLabel", { BackgroundTransparency = 1, Text = text or "", TextSize = size or 14, TextColor3 = color or Theme.text, Font = Enum.Font.Gotham, TextXAlignment = Enum.TextXAlignment.Left, TextTruncate = Enum.TextTruncate.AtEnd, Size = UDim2.new(1, 0, 0, size and (size + 6) or 20), }) for k, v in pairs(props or {}) do l[k] = v end l.Parent = parent return l end local function button(parent, text, cb, opts) opts = opts or {} local b = new("TextButton", { Text = text, TextSize = opts.textSize or 13, Font = Enum.Font.GothamMedium, TextColor3 = opts.textColor or Theme.text, AutoButtonColor = false, BackgroundColor3 = opts.color or Theme.panel3, Size = opts.size or UDim2.new(0, 110, 0, 32), TextTruncate = Enum.TextTruncate.AtEnd, }, parent) corner(b, opts.radius or 8) if opts.accent then useAccent(b, "BackgroundColor3") elseif opts.border ~= false then stroke(b, Theme.border, 1) end padding(b, 6, 0, 6, 0) track(b.MouseEnter:Connect(function() tween(b, { BackgroundTransparency = 0.25 }, 0.1) end)) track(b.MouseLeave:Connect(function() tween(b, { BackgroundTransparency = 0 }, 0.1) end)) if cb then track(b.Activated:Connect(function() cb(b) end)) end return b end local function toggleSwitch(parent, text, initial, cb) local row = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, -6, 0, 30) }, parent) label(row, text, 13, Theme.text, { Size = UDim2.new(1, -60, 1, 0), TextWrapped = true }) local tr = new("TextButton", { Text = "", AutoButtonColor = false, Size = UDim2.new(0, 44, 0, 22), Position = UDim2.new(1, -44, 0.5, -11), BackgroundColor3 = Theme.panel3 }, row) corner(tr, 11) local knob = new("Frame", { Size = UDim2.new(0, 18, 0, 18), Position = UDim2.new(0, 2, 0, 2), BackgroundColor3 = Theme.text }, tr) corner(knob, 9) local state = initial and true or false local function paint() tr.BackgroundColor3 = state and Theme.accent or Theme.panel3 tween(knob, { Position = UDim2.new(0, state and 24 or 2, 0, 2) }, 0.12) end paint() track(tr.Activated:Connect(function() state = not state paint() if cb then cb(state) end end)) return { get = function() return state end, set = function(v) state = v and true or false paint() end } end local function chip(parent, text, color) local c = new("TextLabel", { Text = text, TextSize = 10, Font = Enum.Font.GothamBold, TextColor3 = Theme.bg, BackgroundColor3 = color or Theme.sub, AutomaticSize = Enum.AutomaticSize.X, Size = UDim2.new(0, 0, 0, 16), }, parent) corner(c, 4) padding(c, 5, 0, 5, 0) return c end local function textBox(parent, placeholder, props) local tb = new("TextBox", { PlaceholderText = placeholder or "", PlaceholderColor3 = Theme.muted, Text = "", TextSize = 14, Font = Enum.Font.Gotham, TextColor3 = Theme.text, ClearTextOnFocus = false, BackgroundColor3 = Theme.panel2, Size = UDim2.new(1, 0, 0, 34), TextXAlignment = Enum.TextXAlignment.Left, TextTruncate = Enum.TextTruncate.AtEnd, }) for k, v in pairs(props or {}) do tb[k] = v end tb.Parent = parent corner(tb, 8) stroke(tb, Theme.border, 1) padding(tb, 10, 0, 10, 0) return tb end local function vlist(parent, gap) return new("UIListLayout", { Padding = UDim.new(0, gap or 6), SortOrder = Enum.SortOrder.LayoutOrder, FillDirection = Enum.FillDirection.Vertical }, parent) end local function hlist(parent, gap) return new("UIListLayout", { Padding = UDim.new(0, gap or 6), SortOrder = Enum.SortOrder.LayoutOrder, FillDirection = Enum.FillDirection.Horizontal, VerticalAlignment = Enum.VerticalAlignment.Center }, parent) end local function scroller(parent, props) local s = new("ScrollingFrame", { BackgroundTransparency = 1, BorderSizePixel = 0, ScrollBarThickness = 4, ScrollBarImageColor3 = Theme.border, AutomaticCanvasSize = Enum.AutomaticSize.Y, CanvasSize = UDim2.new(0, 0, 0, 0), Size = UDim2.new(1, 0, 1, 0), ScrollingDirection = Enum.ScrollingDirection.Y, ElasticBehavior = Enum.ElasticBehavior.Never, }) for k, v in pairs(props or {}) do s[k] = v end s.Parent = parent return s end local function errText(err) if type(err) == "table" then return Core.sanitize(err.message or err.code or "unknown error") end return Core.sanitize(tostring(err)) end ---------------------------------------------------------------------- -- ROOT GUI ---------------------------------------------------------------------- local function guiParent() if type(gethui) == "function" then local ok, h = pcall(gethui) if ok and h then return h end end local ok, cg = pcall(function() return game:GetService("CoreGui") end) if ok and cg then local ok2 = pcall(function() local t = Instance.new("Folder") t.Parent = cg t:Destroy() end) if ok2 then return cg end end return LocalPlayer:WaitForChild("PlayerGui") end local gui = new("ScreenGui", { Name = "MineHub_" .. tostring(math.random(100000, 999999)), ResetOnSpawn = false, IgnoreGuiInset = true, DisplayOrder = 999, ZIndexBehavior = Enum.ZIndexBehavior.Sibling, }, guiParent()) local toastHolder = new("Frame", { BackgroundTransparency = 1, AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -20), Size = UDim2.new(0, 360, 0, 200), ZIndex = 100 }, gui) do local l = vlist(toastHolder, 6) l.VerticalAlignment = Enum.VerticalAlignment.Bottom l.HorizontalAlignment = Enum.HorizontalAlignment.Center end local function toast(text, kind) local t = new("TextLabel", { Text = Core.sanitize(text), TextSize = 13, Font = Enum.Font.GothamMedium, TextWrapped = true, TextColor3 = Theme.text, BackgroundColor3 = Theme.panel, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, ZIndex = 101, }, toastHolder) corner(t, 8) stroke(t, (kind == "error" and Theme.danger) or (kind == "ok" and Theme.ok) or Theme.border, 1) padding(t, 10, 8, 10, 8) task.delay(3.5, function() if t.Parent then t:Destroy() end end) end ---------------------------------------------------------------------- -- DRAGGING ---------------------------------------------------------------------- local function makeDraggable(handle, target, onClick) local dragging, moved, startInputPos, startPos = false, false, nil, nil track(handle.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging, moved = true, false startInputPos, startPos = input.Position, target.Position end end)) track(UserInputService.InputChanged:Connect(function(input) if not dragging then return end if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then local delta = input.Position - startInputPos if delta.Magnitude > 5 then moved = true end target.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end)) track(UserInputService.InputEnded:Connect(function(input) if not dragging then return end if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false if not moved and onClick then onClick() end end end)) end ---------------------------------------------------------------------- -- FLOATING ICON + WINDOW ---------------------------------------------------------------------- local icon = new("TextButton", { Name = "FloatIcon", Text = "M", Font = Enum.Font.GothamBlack, TextSize = 22, TextColor3 = Color3.new(1, 1, 1), AutoButtonColor = false, Size = UDim2.new(0, 54, 0, 54), Position = UDim2.new(0, 16, 0.5, -27), }, gui) corner(icon, 16) useAccent(icon, "BackgroundColor3") stroke(icon, Color3.new(1, 1, 1), 1, 0.85) local iconScale = new("UIScale", { Scale = settings.scale }, icon) local window = new("Frame", { Name = "Window", BackgroundColor3 = Theme.bg, BackgroundTransparency = settings.transparency, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 820, 0, 560), Visible = false, ClipsDescendants = true, }, gui) corner(window, 14) stroke(window, Theme.border, 1) local windowScale = new("UIScale", { Scale = settings.scale }, window) local topbar = new("Frame", { BackgroundColor3 = Theme.panel, Size = UDim2.new(1, 0, 0, 44) }, window) new("Frame", { BackgroundColor3 = Theme.border, BorderSizePixel = 0, Size = UDim2.new(1, 0, 0, 1), Position = UDim2.new(0, 0, 1, -1) }, topbar) local logo = new("Frame", { Size = UDim2.new(0, 22, 0, 22), Position = UDim2.new(0, 14, 0.5, -11) }, topbar) corner(logo, 7) useAccent(logo, "BackgroundColor3") label(topbar, "Mine Hub", 16, Theme.text, { Font = Enum.Font.GothamBold, Position = UDim2.new(0, 44, 0, 0), Size = UDim2.new(0, 100, 1, 0) }) label(topbar, "free & keyless scripts · rscripts", 11, Theme.muted, { Position = UDim2.new(0, 140, 0, 0), Size = UDim2.new(1, -230, 1, 0) }) local closeBtn = button(topbar, "×", nil, { size = UDim2.new(0, 32, 0, 28), textSize = 18, border = false, color = Theme.panel2 }) closeBtn.Position = UDim2.new(1, -40, 0.5, -14) local minBtn = button(topbar, "–", nil, { size = UDim2.new(0, 32, 0, 28), textSize = 18, border = false, color = Theme.panel2 }) minBtn.Position = UDim2.new(1, -76, 0.5, -14) local nav = new("Frame", { BackgroundColor3 = Theme.panel, BorderSizePixel = 0 }, window) local content = new("Frame", { BackgroundTransparency = 1 }, window) local navLayout = vlist(nav, 4) padding(nav, 10, 10, 10, 10) local PAGE_NAMES = { "Home", "Search", "Saved", "Settings" } local pages, navButtons = {}, {} local currentPage = "Home" for _, name in ipairs(PAGE_NAMES) do pages[name] = new("Frame", { Name = name, BackgroundTransparency = 1, Size = UDim2.new(1, 0, 1, 0), Visible = false }, content) end local detail -- forward (detail overlay) local function showPage(name) currentPage = name if detail then detail.Visible = false end for n, f in pairs(pages) do f.Visible = (n == name) end for n, b in pairs(navButtons) do b.BackgroundColor3 = (n == name) and Theme.accent or Theme.panel2 b.TextColor3 = (n == name) and Color3.new(1, 1, 1) or Theme.sub end end for i, name in ipairs(PAGE_NAMES) do local b = button(nav, name, function() showPage(name) end, { size = UDim2.new(1, 0, 0, 34), border = false, color = Theme.panel2 }) b.LayoutOrder = i navButtons[name] = b end local function applyLayout() local vs = gui.AbsoluteSize if vs.X <= 0 or vs.Y <= 0 then return end local s = settings.scale local vw, vh = vs.X / s, vs.Y / s local narrow = vw < 640 local w, h if narrow then w, h = math.floor(vw * 0.96), math.floor(vh * 0.90) else w, h = math.min(820, math.floor(vw * 0.84)), math.min(560, math.floor(vh * 0.84)) end window.Size = UDim2.new(0, w, 0, h) if narrow then nav.Size, nav.Position = UDim2.new(1, 0, 0, 54), UDim2.new(0, 0, 1, -54) navLayout.FillDirection = Enum.FillDirection.Horizontal navLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center for _, b in pairs(navButtons) do b.Size = UDim2.new(0.24, -4, 1, 0) end content.Position, content.Size = UDim2.new(0, 0, 0, 44), UDim2.new(1, 0, 1, -98) else nav.Size, nav.Position = UDim2.new(0, 150, 1, -44), UDim2.new(0, 0, 0, 44) navLayout.FillDirection = Enum.FillDirection.Vertical navLayout.HorizontalAlignment = Enum.HorizontalAlignment.Left for _, b in pairs(navButtons) do b.Size = UDim2.new(1, 0, 0, 34) end content.Position, content.Size = UDim2.new(0, 150, 0, 44), UDim2.new(1, -150, 1, -44) end end applyLayout() track(gui:GetPropertyChangedSignal("AbsoluteSize"):Connect(applyLayout)) local isOpen = false local function setOpen(open) if open == isOpen then return end isOpen = open if open then window.Visible = true windowScale.Scale = settings.scale * 0.94 window.BackgroundTransparency = 1 tween(windowScale, { Scale = settings.scale }, 0.18, Enum.EasingStyle.Back) tween(window, { BackgroundTransparency = settings.transparency }, 0.15) else local tw = tween(windowScale, { Scale = settings.scale * 0.94 }, 0.12) if tw then tw.Completed:Once(function() if not isOpen then window.Visible = false end end) else window.Visible = false end end end makeDraggable(icon, icon, function() setOpen(not isOpen) end) makeDraggable(topbar, window, nil) track(closeBtn.Activated:Connect(function() setOpen(false) end)) track(minBtn.Activated:Connect(function() setOpen(false) end)) ---------------------------------------------------------------------- -- CONFIRM DIALOG + RUNNER ---------------------------------------------------------------------- local function confirmDialog(title, body, yesText, onYes) local overlay = new("TextButton", { Text = "", AutoButtonColor = false, BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.45, Size = UDim2.new(1, 0, 1, 0), ZIndex = 50 }, window) local box = new("Frame", { BackgroundColor3 = Theme.panel, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 340, 0, 180), ZIndex = 51 }, overlay) corner(box, 12) stroke(box, Theme.border) padding(box, 14, 12, 14, 12) label(box, title, 15, Theme.text, { Font = Enum.Font.GothamBold, ZIndex = 52 }) label(box, body, 12, Theme.sub, { Position = UDim2.new(0, 0, 0, 26), Size = UDim2.new(1, 0, 0, 90), TextWrapped = true, TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 52, TextTruncate = Enum.TextTruncate.None }) local yes = button(box, yesText or "Run", function() overlay:Destroy() onYes() end, { size = UDim2.new(0, 100, 0, 32), color = Theme.danger, border = false }) yes.Position, yes.ZIndex = UDim2.new(1, -100, 1, -32), 52 local no = button(box, "Cancel", function() overlay:Destroy() end, { size = UDim2.new(0, 100, 0, 32) }) no.Position, no.ZIndex = UDim2.new(1, -210, 1, -32), 52 end -- Downloads (cached) and executes an entry. status(text, kind) receives progress. local function executeEntry(entry, status) status = status or toast if not loadstringFn then status("Run unavailable: this executor has no loadstring.", "error") return end status("Downloading " .. entry.title .. "…") task.spawn(function() local src, err = client:fetchSource(entry) if not Hub.alive then return end if not src then status("Download failed: " .. errText(err), "error") log("Source: " .. errText(err), true) return end local fn, compileErr = loadstringFn(src, "=MineHub:" .. tostring(entry.slug or entry.id)) if type(fn) ~= "function" then local msg = "Compile error: " .. Core.sanitize(tostring(compileErr or "loadstring returned nil")) status(msg, "error") log(msg, true) return end status("Running " .. entry.title, "ok") log("Run: " .. entry.title) task.spawn(function() local ok, rerr = pcall(fn) if not ok then local msg = "Runtime error in " .. entry.title .. ": " .. Core.sanitize(tostring(rerr)) log(msg, true) if Hub.alive then toast(msg, "error") end end end) end) end local function runEntry(entry, status) if settings.confirmRun then confirmDialog("Run \"" .. entry.title .. "\"?", "This executes third-party code from rscripts in your client. Mine Hub cannot verify what it does. Scripts keep running after the hub unloads. (Disable this prompt in Settings.)", "Run", function() executeEntry(entry, status) end) else executeEntry(entry, status) end end local function copyText(text, what) if not clipboardFn then toast("Clipboard not available in this executor.", "error") return false end local ok = pcall(clipboardFn, text) toast(ok and ("Copied " .. what) or "Clipboard write failed.", ok and "ok" or "error") return ok end ---------------------------------------------------------------------- -- CARD + LIST VIEW ---------------------------------------------------------------------- local openDetail local MAX_RENDERED = 150 local refreshSaved -- forward local function buildCard(parent, entry, order) local card = new("TextButton", { Text = "", AutoButtonColor = false, BackgroundColor3 = Theme.panel, Size = UDim2.new(1, -6, 0, 92), LayoutOrder = order }, parent) corner(card, 10) local st = stroke(card, entry.thisGame and Theme.accent or Theme.border, 1) padding(card, 12, 8, 10, 8) local rightW = loadstringFn and 70 or 36 label(card, entry.title, 14, Theme.text, { Font = Enum.Font.GothamBold, Size = UDim2.new(1, -rightW, 0, 20) }) local by = "by " .. entry.author.username .. (entry.author.isVerified and " ✓" or "") label(card, by .. " · " .. (entry.game.title or "Universal / unknown game"), 12, Theme.sub, { Position = UDim2.new(0, 0, 0, 22), Size = UDim2.new(1, -rightW, 0, 16) }) label(card, (tostring(entry.description or ""):gsub("%s+", " ")), 11, Theme.muted, { Position = UDim2.new(0, 0, 0, 40), Size = UDim2.new(1, -rightW, 0, 15) }) local chips = new("Frame", { BackgroundTransparency = 1, Position = UDim2.new(0, 0, 0, 58), Size = UDim2.new(1, -rightW, 0, 16) }, card) hlist(chips, 4) if entry.thisGame then chip(chips, "THIS GAME", Theme.accent) end if entry.flags.keySystem then chip(chips, "KEY", Theme.warn) else chip(chips, "KEYLESS", Theme.ok) end if entry.flags.paid then chip(chips, "PAID", Theme.warn) end if entry.flags.patched then chip(chips, "PATCHED", Theme.danger) end if entry.flags.mobile then chip(chips, "MOBILE", Theme.sub) end if entry.views then chip(chips, tostring(entry.views) .. " views", Theme.muted) end if autorun:has(entry.id) then chip(chips, "AUTORUN", Theme.accent) end local fav = new("TextButton", { Text = favorites:has(entry.id) and "★" or "☆", TextSize = 20, Font = Enum.Font.GothamBold, TextColor3 = favorites:has(entry.id) and Theme.warn or Theme.muted, BackgroundTransparency = 1, Size = UDim2.new(0, 28, 0, 28), Position = UDim2.new(1, -26, 0, 0), }, card) track(fav.Activated:Connect(function() local on = favorites:toggle(entry) fav.Text = on and "★" or "☆" fav.TextColor3 = on and Theme.warn or Theme.muted saveFavorites() if refreshSaved then refreshSaved() end end)) if loadstringFn then local run = new("TextButton", { Text = "▶", TextSize = 14, Font = Enum.Font.GothamBold, TextColor3 = Color3.new(1, 1, 1), BackgroundColor3 = Theme.ok, AutoButtonColor = false, Size = UDim2.new(0, 28, 0, 28), Position = UDim2.new(1, -60, 0, 0), }, card) corner(run, 8) track(run.Activated:Connect(function() runEntry(entry, toast) end)) end track(card.MouseEnter:Connect(function() st.Color = Theme.accent end)) track(card.MouseLeave:Connect(function() st.Color = entry.thisGame and Theme.accent or Theme.border end)) track(card.Activated:Connect(function() openDetail(entry) end)) return card end local ListView = {} ListView.__index = ListView function ListView.new(parent, opts) opts = opts or {} local self = setmetatable({}, ListView) self.frame = new("Frame", { BackgroundTransparency = 1, Size = opts.size or UDim2.new(1, 0, 1, 0), Position = opts.position or UDim2.new(0, 0, 0, 0) }, parent) self.status = label(self.frame, "", 12, Theme.sub, { Size = UDim2.new(1, 0, 0, 18) }) self.scroll = scroller(self.frame, { Position = UDim2.new(0, 0, 0, 20), Size = UDim2.new(1, 0, 1, -20) }) vlist(self.scroll, 6) padding(self.scroll, 0, 0, 6, 0) self.items = {} if opts.onNearEnd then track(self.scroll:GetPropertyChangedSignal("CanvasPosition"):Connect(function() local s = self.scroll local maxY = s.AbsoluteCanvasSize.Y - s.AbsoluteWindowSize.Y if maxY > 0 and s.CanvasPosition.Y >= maxY - 120 then opts.onNearEnd() end end)) end return self end function ListView:setStatus(text, kind) self.status.Text = Core.sanitize(text or "") self.status.TextColor3 = (kind == "error" and Theme.danger) or (kind == "ok" and Theme.ok) or Theme.sub end function ListView:clear() for _, c in ipairs(self.scroll:GetChildren()) do if c:IsA("GuiObject") then c:Destroy() end end self.items = {} end function ListView:render(items, controls) self:clear() self.items = items local from, to = Core.renderWindow(items, MAX_RENDERED) local order = 0 if from > 1 then order = order + 1 label(self.scroll, string.format("Showing %d–%d of %d loaded.", from, to, #items), 11, Theme.muted, { Size = UDim2.new(1, -6, 0, 18), LayoutOrder = order }) end for i = from, to do order = order + 1 buildCard(self.scroll, items[i], order) end if #items == 0 and controls and controls.emptyText then order = order + 1 label(self.scroll, controls.emptyText, 13, Theme.muted, { Size = UDim2.new(1, -6, 0, 40), LayoutOrder = order, TextWrapped = true }) end if controls and controls.loadMore then order = order + 1 local b = button(self.scroll, controls.loadMoreText or "Load more", controls.loadMore, { size = UDim2.new(1, -6, 0, 36), accent = true }) b.LayoutOrder = order end if controls and controls.retry then order = order + 1 local b = button(self.scroll, "Retry", controls.retry, { size = UDim2.new(1, -6, 0, 36), accent = true }) b.LayoutOrder = order end end ---------------------------------------------------------------------- -- CATALOG PAGE (Home / Search) ---------------------------------------------------------------------- local function makeCatalogPage(pageFrame, mode) local P = { q = "", sort = "newest", thisGame = false, trendingMode = false, noKeySystem = settings.noKeyDefault, freeOnly = settings.freeDefault, mobileOnly = false, verifiedOnly = false, items = {}, page = 0, totalPages = nil, hasNext = false, seen = {}, seq = Core.Sequencer.new(), loading = false, lastError = nil, } padding(pageFrame, 12, 10, 12, 10) local controlsH = (mode == "search") and 114 or 74 local controls = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, controlsH) }, pageFrame) vlist(controls, 6) local list list = ListView.new(pageFrame, { position = UDim2.new(0, 0, 0, controlsH + 6), size = UDim2.new(1, 0, 1, -(controlsH + 6)), onNearEnd = function() if settings.infiniteScroll and P.loadMore then P.loadMore() end end, }) local searchBox if mode == "search" then local row0 = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 34), LayoutOrder = 1 }, controls) hlist(row0, 6) searchBox = textBox(row0, "Search scripts or game names (e.g. blox fruits)…", { Size = UDim2.new(1, -96, 1, 0) }) button(row0, "Search", function() P.q = Core.trim(searchBox.Text) P.reload() end, { size = UDim2.new(0, 90, 1, 0), accent = true }) end local row1 = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 34), LayoutOrder = 3 }, controls) hlist(row1, 6) local row2 = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 34), LayoutOrder = 4 }, controls) hlist(row2, 6) local function paintToggle(b, on) b.BackgroundColor3 = on and Theme.accent or Theme.panel3 end local function filterBtn(text, key) local b b = button(row2, text, function() P[key] = not P[key] paintToggle(b, P[key]) P.reload() end, { size = UDim2.new(0.25, -5, 1, 0) }) paintToggle(b, P[key]) return b end button(row1, "Sort: " .. Core.findSort(P.sort).label, function(b) local idx = 1 for i, s in ipairs(Core.SORTS) do if s.id == P.sort then idx = i end end local s = Core.SORTS[(idx % #Core.SORTS) + 1] P.sort = s.id b.Text = "Sort: " .. s.label P.reload() end, { size = UDim2.new(mode == "home" and 0.4 or 1, -5, 1, 0) }) if mode == "home" then local gameBtn, trendBtn gameBtn = button(row1, "This game", function() P.thisGame = not P.thisGame if P.thisGame then P.trendingMode = false paintToggle(trendBtn, false) end paintToggle(gameBtn, P.thisGame) P.reload() end, { size = UDim2.new(0.3, -5, 1, 0) }) trendBtn = button(row1, "Trending", function() P.trendingMode = not P.trendingMode if P.trendingMode then P.thisGame = false paintToggle(gameBtn, false) end paintToggle(trendBtn, P.trendingMode) P.reload() end, { size = UDim2.new(0.3, -5, 1, 0) }) P.gameBtn = gameBtn end filterBtn("No key", "noKeySystem") filterBtn("Free", "freeOnly") filterBtn("Mobile", "mobileOnly") filterBtn("Verified", "verifiedOnly") local function filters() return { noKeySystem = P.noKeySystem, freeOnly = P.freeOnly, mobileOnly = P.mobileOnly, verifiedOnly = P.verifiedOnly } end local function describe() if P.trendingMode then return string.format("Trending · %d shown after filters", #P.items) end local s = string.format("%d loaded", #P.items) if P.totalPages then s = s .. string.format(" · page %d/%d", P.page, P.totalPages) end if P.singlePage then s = s .. " · this sort only has 1 page (rscripts API limit)" end if P.thisGame then s = s .. " · searched \"" .. (P.gameQuery or "?") .. "\"" end return s end local function renderList() local canMore = P.hasNext and not P.trendingMode list:render(P.items, { emptyText = P.lastError and ("Failed to load: " .. P.lastError) or (P.thisGame and "No scripts found for this game with the current filters. Try turning off \"No key\"/\"Free\".") or "No scripts matched.", loadMore = canMore and P.loadMore or nil, loadMoreText = canMore and string.format("Load more (page %d)", P.page + 1) or nil, retry = P.lastError and P.reload or nil, }) end local function fetchPage(pageNum, append) if not client:canRequest() then P.lastError = "this executor has no HTTP function (request / game:HttpGet)." list:setStatus(P.lastError, "error") renderList() return end local token = P.seq:next() P.loading = true list:setStatus(append and "Loading more…" or "Loading…") task.spawn(function() local res, err if P.trendingMode then res, err = client:trending() if res then local f, kept = filters(), {} for _, e in ipairs(res.items) do if Core.passesFilters(e, f) then kept[#kept + 1] = e end end res.items = kept end else local q = P.q if P.thisGame then local name = Core.cleanGameName(getGameName()) P.gameQuery = name q = name end local opts = filters() opts.q, opts.page, opts.sort = q, pageNum, P.sort res, err = client:listScripts(opts) if res then local f, kept = filters(), {} for _, e in ipairs(res.items) do if Core.passesFilters(e, f) then kept[#kept + 1] = e end end res.items = kept end end if not Hub.alive or not P.seq:isCurrent(token) then return end P.loading = false if not res then P.lastError = errText(err) list:setStatus(P.lastError, "error") log("Catalog: " .. P.lastError, true) if not append then P.items = {} end renderList() return end P.lastError = nil if not append then P.items, P.seen = {}, {} end for _, e in ipairs(res.items) do if not P.seen[e.id] then P.seen[e.id] = true P.items[#P.items + 1] = e end end if P.thisGame then P.items = Core.rankByPlace(P.items, game.PlaceId) end P.page, P.totalPages, P.hasNext, P.singlePage = res.page, res.totalPages, res.hasNext, res.singlePage renderList() list:setStatus(describe(), "ok") end) end function P.reload() P.items, P.seen = {}, {} P.page, P.totalPages, P.hasNext = 0, nil, false list.scroll.CanvasPosition = Vector2.new(0, 0) fetchPage(1, false) end function P.loadMore() if P.loading or not P.hasNext or P.trendingMode then return end fetchPage(P.page + 1, true) end if searchBox then local debounced = Core.makeDebounce(0.6, function(text) if not Hub.alive then return end local t = Core.trim(text) if t == P.q then return end P.q = t P.reload() end) track(searchBox:GetPropertyChangedSignal("Text"):Connect(function() debounced(searchBox.Text) end)) track(searchBox.FocusLost:Connect(function(enter) if enter then P.q = Core.trim(searchBox.Text) P.reload() end end)) end P.list = list return P end local homePage = makeCatalogPage(pages.Home, "home") local searchPage = makeCatalogPage(pages.Search, "search") local searchLoaded = false track(pages.Search:GetPropertyChangedSignal("Visible"):Connect(function() if pages.Search.Visible and not searchLoaded then searchLoaded = true searchPage.reload() end end)) ---------------------------------------------------------------------- -- SAVED PAGE (Favorites / Recent / Autorun) ---------------------------------------------------------------------- do local f = pages.Saved padding(f, 12, 10, 12, 10) local tabs = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 34) }, f) hlist(tabs, 6) local views, btns = {}, {} local defs = { { key = "fav", text = "Favorites", list = favorites, empty = "No favorites yet. Tap ☆ on a card." }, { key = "recent", text = "Recent", list = recent, empty = "Nothing viewed yet." }, { key = "auto", text = "Autorun", list = autorun, empty = "No autorun scripts. Open a script and enable \"Autorun\"." }, } local active = "fav" local function refresh() for _, d in ipairs(defs) do views[d.key]:render(d.list:list(), { emptyText = d.empty }) local extra = store.available and "" or " · session only (no filesystem)" if d.key == "auto" then extra = extra .. string.format(" · %d match this game", #Core.autorunFor(autorun:list(), game.PlaceId)) end views[d.key]:setStatus(string.format("%d item(s)%s", #d.list:list(), extra)) end end local function selectTab(key) active = key for _, d in ipairs(defs) do views[d.key].frame.Visible = (d.key == key) btns[d.key].BackgroundColor3 = (d.key == key) and Theme.accent or Theme.panel3 end refresh() end for _, d in ipairs(defs) do views[d.key] = ListView.new(f, { position = UDim2.new(0, 0, 0, 40), size = UDim2.new(1, 0, 1, -40) }) btns[d.key] = button(tabs, d.text, function() selectTab(d.key) end, { size = UDim2.new(0, 100, 1, 0) }) end refreshSaved = refresh selectTab(active) end ---------------------------------------------------------------------- -- DETAIL VIEW ---------------------------------------------------------------------- detail = new("Frame", { BackgroundColor3 = Theme.bg, Size = UDim2.new(1, 0, 1, 0), Visible = false, ZIndex = 5 }, content) padding(detail, 12, 10, 12, 10) local detailTop = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 34) }, detail) hlist(detailTop, 6) local backBtn = button(detailTop, "← Back", nil, { size = UDim2.new(0, 80, 1, 0) }) local detailStatus = label(detailTop, "", 12, Theme.sub, { Size = UDim2.new(1, -90, 1, 0), TextWrapped = true }) local detailScroll = scroller(detail, { Position = UDim2.new(0, 0, 0, 40), Size = UDim2.new(1, 0, 1, -40) }) vlist(detailScroll, 8) padding(detailScroll, 0, 0, 6, 0) local detailState = { id = nil } local function setDetailStatus(text, kind) detailStatus.Text = Core.sanitize(text or "") detailStatus.TextColor3 = (kind == "error" and Theme.danger) or (kind == "ok" and Theme.ok) or Theme.sub end local function teleportTo(entry, statusFn) local pid = tonumber(entry.game and entry.game.placeId) if not pid then statusFn("No place ID for this script's game.", "error") return false end if pid == game.PlaceId then statusFn("You are already in this game.", "ok") return false end local ok, err = pcall(function() TeleportService:Teleport(pid, LocalPlayer) end) if not ok then local msg = "Teleport failed: " .. Core.sanitize(tostring(err)) statusFn(msg, "error") log(msg, true) return false end statusFn("Teleporting… (put MineHub in your executor's autoexec to keep it after teleport)", "ok") return true end local function renderDetail(entry) for _, c in ipairs(detailScroll:GetChildren()) do if c:IsA("GuiObject") then c:Destroy() end end local order = 0 local function row(h) order = order + 1 local r = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, -6, 0, h), LayoutOrder = order }, detailScroll) hlist(r, 6) return r end local function textRow(text, size, color, bold) order = order + 1 return label(detailScroll, text, size, color, { LayoutOrder = order, TextWrapped = true, Size = UDim2.new(1, -6, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, Font = bold and Enum.Font.GothamBold or Enum.Font.Gotham, TextTruncate = Enum.TextTruncate.None, }) end textRow(entry.title, 18, Theme.text, true) textRow(string.format("by %s%s", entry.author.username, entry.author.isVerified and " (verified)" or ""), 13, Theme.sub) textRow("Game: " .. (entry.game.title or "universal / not specified") .. (entry.game.placeId and (" (place " .. entry.game.placeId .. ")") or ""), 13, Theme.sub) local stats = {} if entry.views then stats[#stats + 1] = tostring(entry.views) .. " views" end if entry.likes then stats[#stats + 1] = tostring(entry.likes) .. " likes" end if entry.dislikes then stats[#stats + 1] = tostring(entry.dislikes) .. " dislikes" end if entry.lastUpdatedAt then stats[#stats + 1] = "updated " .. entry.lastUpdatedAt:sub(1, 10) end if #stats > 0 then textRow(table.concat(stats, " · "), 12, Theme.muted) end local chipRow = row(18) for _, r in ipairs(Core.requirementsOf(entry)) do chip(chipRow, r, (r == "FREE · KEYLESS") and Theme.ok or Theme.warn) end if entry.flags.mobile then chip(chipRow, "MOBILE READY", Theme.sub) end if #entry.executors > 0 then local names = {} for _, ex in ipairs(entry.executors) do names[#names + 1] = ex.name .. (#ex.platforms > 0 and (" [" .. table.concat(ex.platforms, "/") .. "]") or "") end textRow("Tested executors: " .. table.concat(names, ", "), 12, Theme.sub) end -- Actions local a1 = row(36) if loadstringFn then button(a1, "▶ Run", function() runEntry(entry, setDetailStatus) end, { size = UDim2.new(0.25, -5, 1, 0), color = Theme.ok, border = false }) end button(a1, favorites:has(entry.id) and "★ Saved" or "☆ Save", function(b) local on = favorites:toggle(entry) b.Text = on and "★ Saved" or "☆ Save" saveFavorites() refreshSaved() end, { size = UDim2.new(0.25, -5, 1, 0) }) button(a1, "Copy loader", function() local line = Core.loaderLine(entry) if line then copyText(line, "loader line") else toast("No raw URL for this script.", "error") end end, { size = UDim2.new(0.25, -5, 1, 0) }) button(a1, "Copy source", function() setDetailStatus("Downloading source…") task.spawn(function() local src, err = client:fetchSource(entry) if not Hub.alive or detailState.id ~= entry.id then return end if not src then setDetailStatus(errText(err), "error") return end setDetailStatus(string.format("Source: %d chars.", #src), "ok") copyText(src, "source") end) end, { size = UDim2.new(0.25, -5, 1, 0) }) local a2 = row(36) local function autorunText() local e = autorun.byId[entry.id] if not e then return "Autorun: off" end return e.anyGame and "Autorun: every game" or "Autorun: this script's game" end button(a2, autorunText(), function(b) -- cycle: off -> this game -> every game -> off local e = autorun.byId[entry.id] if not e then local copy = {} for k, v in pairs(entry) do copy[k] = v end copy.thisGame = nil copy.anyGame = entry.game.placeId == nil -- universal scripts run everywhere autorun:add(copy) elseif not e.anyGame then e.anyGame = true else autorun:remove(entry.id) end saveAutorun() b.Text = autorunText() refreshSaved() end, { size = UDim2.new(0.5, -5, 1, 0) }) if entry.game.placeId then button(a2, "Join game", function() teleportTo(entry, setDetailStatus) end, { size = UDim2.new(0.5, -5, 1, 0), accent = true }) end local a3 = row(36) button(a3, "View source", function(b) b.Text = "…" task.spawn(function() local src, err = client:fetchSource(entry) if not Hub.alive or detailState.id ~= entry.id then return end b.Text = "View source" if not src then setDetailStatus(errText(err), "error") return end order = order + 1 local holder = new("Frame", { BackgroundColor3 = Theme.panel, Size = UDim2.new(1, -6, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, LayoutOrder = 1000 }, detailScroll) corner(holder, 8) stroke(holder, Theme.border) padding(holder, 8, 8, 8, 8) local limit = 30000 -- TextBox rendering cap new("TextBox", { Text = #src > limit and (src:sub(1, limit) .. "\n-- [truncated; use Copy source]") or src, TextEditable = false, ClearTextOnFocus = false, MultiLine = true, TextWrapped = true, Font = Enum.Font.Code, TextSize = 12, TextColor3 = Theme.text, BackgroundTransparency = 1, TextXAlignment = Enum.TextXAlignment.Left, TextYAlignment = Enum.TextYAlignment.Top, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, }, holder) b.Visible = false end) end, { size = UDim2.new(0.5, -5, 1, 0) }) if entry.pageUrl then button(a3, "Copy page link", function() copyText(entry.pageUrl, "page link") end, { size = UDim2.new(0.5, -5, 1, 0) }) end if entry.links.discord then local a4 = row(30) button(a4, "Copy Discord", function() copyText(entry.links.discord, "Discord link") end, { size = UDim2.new(0.5, -5, 1, 0) }) end textRow("Description", 13, Theme.text, true) local desc = entry.description ~= "" and entry.description or "(no description)" if #desc > 4000 then desc = desc:sub(1, 4000) .. "…" end textRow(desc, 12, Theme.sub) end openDetail = function(entry) detailState.id = entry.id recent:add(entry) saveRecent() refreshSaved() detail.Visible = true detailScroll.CanvasPosition = Vector2.new(0, 0) setDetailStatus("") renderDetail(entry) if settings.autoTeleport and entry.game.placeId and tonumber(entry.game.placeId) ~= game.PlaceId then teleportTo(entry, setDetailStatus) end end track(backBtn.Activated:Connect(function() detail.Visible = false detailState.id = nil end)) ---------------------------------------------------------------------- -- SETTINGS PAGE ---------------------------------------------------------------------- local capturingKey = false do local f = pages.Settings padding(f, 12, 10, 12, 10) local s = scroller(f) vlist(s, 8) padding(s, 0, 0, 6, 0) local function section(text) label(s, text, 14, Theme.text, { Font = Enum.Font.GothamBold, Size = UDim2.new(1, -6, 0, 22) }) end local function note(text, color) return label(s, text, 11, color or Theme.muted, { TextWrapped = true, AutomaticSize = Enum.AutomaticSize.Y, Size = UDim2.new(1, -6, 0, 0), TextTruncate = Enum.TextTruncate.None }) end local function setting(text, key, after) toggleSwitch(s, text, settings[key], function(v) settings[key] = v saveSettings() if after then after(v) end end) end section("Catalog") setting("Start with \"No key\" filter on", "noKeyDefault") setting("Start with \"Free\" filter on", "freeDefault") setting("Load next page when scrolled to the bottom", "infiniteScroll") setting("Ask before running a script", "confirmRun") setting("Run Autorun scripts when the hub loads", "autorunEnabled") setting("Teleport to a script's game when its card is opened", "autoTeleport") section("Appearance") local accentRow = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, -6, 0, 30) }, s) hlist(accentRow, 6) label(accentRow, "Accent", 13, Theme.sub, { Size = UDim2.new(0, 50, 1, 0) }) local function setAccent(hex) local r, g, b = Core.hexToRgb(hex) if not r then return end settings.accent = hex Theme.accent = Color3.fromRGB(r, g, b) applyAccent() showPage(currentPage) saveSettings() end for _, hex in ipairs({ "#6C8CFF", "#9B6CFF", "#4FD1C5", "#56C67E", "#F2B848", "#EC5A5A", "#FF6CB5" }) do local r, g, b = Core.hexToRgb(hex) local sw = new("TextButton", { Text = "", BackgroundColor3 = Color3.fromRGB(r, g, b), Size = UDim2.new(0, 22, 0, 22), AutoButtonColor = false }, accentRow) corner(sw, 8) track(sw.Activated:Connect(function() setAccent(hex) end)) end local function stepper(name, get, set, step, lo, hi, fmt) local r = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, -6, 0, 30) }, s) hlist(r, 6) label(r, name, 13, Theme.sub, { Size = UDim2.new(0, 110, 1, 0) }) local val = label(r, "", 13, Theme.text, { Size = UDim2.new(0, 60, 1, 0), TextXAlignment = Enum.TextXAlignment.Center }) local function paint() val.Text = string.format(fmt, get()) end button(r, "−", function() set(Core.clamp(get() - step, lo, hi)) paint() end, { size = UDim2.new(0, 32, 1, 0) }) button(r, "+", function() set(Core.clamp(get() + step, lo, hi)) paint() end, { size = UDim2.new(0, 32, 1, 0) }) paint() end stepper("Interface scale", function() return settings.scale end, function(v) settings.scale = v windowScale.Scale, iconScale.Scale = v, v applyLayout() saveSettings() end, 0.1, 0.7, 1.5, "%.1f") stepper("Transparency", function() return settings.transparency end, function(v) settings.transparency = v window.BackgroundTransparency = v saveSettings() end, 0.05, 0, 0.8, "%.2f") setting("Animations", "animations") section("Controls") local keyBtn = button(s, "Open/close key: " .. settings.toggleKey, function(b) capturingKey = true b.Text = "Press a key… (Esc to cancel)" end, { size = UDim2.new(1, -6, 0, 32) }) Hub.keyBtn = keyBtn note("Keyboard only; on mobile use the floating M icon.") section("Environment") note("Executor: " .. executorName .. " · Mine Hub " .. Core.VERSION) local httpDesc = Core.deps.request and ("request function (" .. tostring(detectedRequestName) .. ")" .. (Core.deps.httpGet and " + HttpGet fallback" or "")) or (Core.deps.httpGet and "game:HttpGet" or "NOT available — catalog cannot load") note("HTTP: " .. httpDesc, client:canRequest() and Theme.ok or Theme.danger) note("Persistence: " .. (store.available and "saved in MineHub/ folder" or "no writefile — session only"), store.available and Theme.ok or Theme.warn) note(string.format("Clipboard: %s · loadstring: %s", clipboardFn and "yes" or "no", loadstringFn and "yes" or "no")) note("No API key needed: uses the public rscripts.net/api/v2 endpoints.") local btnRow = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, -6, 0, 32) }, s) hlist(btnRow, 6) button(btnRow, "Clear cache", function() client.cache:clear() toast("Cache cleared.", "ok") end, { size = UDim2.new(0, 110, 1, 0) }) button(btnRow, "Reload", function() client.cache:clear() homePage.reload() showPage("Home") end, { size = UDim2.new(0, 90, 1, 0) }) button(btnRow, "Unload hub", function() if genv.MineHub then genv.MineHub.Destroy() end end, { size = UDim2.new(0, 110, 1, 0), color = Theme.danger, border = false }) section("Log") local logBox = label(s, "", 11, Theme.sub, { TextWrapped = true, AutomaticSize = Enum.AutomaticSize.Y, Size = UDim2.new(1, -6, 0, 0), Font = Enum.Font.Code, TextTruncate = Enum.TextTruncate.None, TextYAlignment = Enum.TextYAlignment.Top }) local function paintLog() logBox.Text = #logLines > 0 and table.concat(logLines, "\n") or "(empty)" end logListeners[#logListeners + 1] = paintLog paintLog() end ---------------------------------------------------------------------- -- KEYBOARD ---------------------------------------------------------------------- track(UserInputService.InputBegan:Connect(function(input, gameProcessed) if input.UserInputType ~= Enum.UserInputType.Keyboard then return end if capturingKey then capturingKey = false if input.KeyCode ~= Enum.KeyCode.Escape and input.KeyCode ~= Enum.KeyCode.Unknown then settings.toggleKey = input.KeyCode.Name saveSettings() end if Hub.keyBtn then Hub.keyBtn.Text = "Open/close key: " .. settings.toggleKey end return end if gameProcessed then return end if input.KeyCode.Name == settings.toggleKey then setOpen(not isOpen) end end)) ---------------------------------------------------------------------- -- GLOBAL HANDLE + STARTUP ---------------------------------------------------------------------- genv.MineHub = { Version = Core.VERSION, Gui = gui, Open = function() setOpen(true) end, Close = function() setOpen(false) end, Toggle = function() setOpen(not isOpen) end, Destroy = function() if not Hub.alive then return end Hub.alive = false client.alive = false for _, c in ipairs(Hub.conns) do pcall(function() c:Disconnect() end) end Hub.conns = {} pcall(function() gui:Destroy() end) if genv.MineHub and genv.MineHub.Gui == gui then genv.MineHub = nil end end, } showPage("Home") if store.lastError then log("Persistence read error: " .. store.lastError, true) end if not client:canRequest() then log("No HTTP function (request/http_request/game:HttpGet); catalog disabled.", true) end homePage.reload() if settings.autorunEnabled then local due = Core.autorunFor(autorun:list(), game.PlaceId) for _, e in ipairs(due) do executeEntry(e, function(text, kind) if kind == "error" then toast(text, kind) end log(text, kind == "error") end) end if #due > 0 then toast(string.format("Autorun: starting %d script(s)", #due), "ok") end end setOpen(true)