-- offline smoke harness for street-life-remastered.lua (Lua 5.5 via lupa) -- permissive Roblox stubs + fake UI library, then loads SRC local NUM = { X = true, Y = true, Z = true, Offset = true, Scale = true, Magnitude = true, Value = true, Health = true, MaxHealth = true, PlaceVersion = true, UserId = true, Transparency = true, Brightness = true, PlaceId = true, Count = true, FieldOfView = true, WalkSpeed = true, JumpPower = true, Throttle = true, HipHeight = true, HealthRatio = true, } local function stub(name) local t = {} local mt = {} mt.__index = function(self, k) if type(k) == "number" then return nil end if NUM[k] then return 0 end local v = stub(name .. "." .. tostring(k)) rawset(self, k, v) return v end mt.__call = function() return stub(name .. "()") end mt.__tostring = function() return "<" .. name .. ">" end mt.__concat = function() return "" end mt.__len = function() return 0 end mt.__add = function() return 0 end mt.__sub = function() return stub(name .. "-") end mt.__mul = function() return 0 end mt.__div = function() return 0 end mt.__unm = function() return 0 end mt.__lt = function() return false end mt.__le = function() return false end mt.__eq = function() return false end mt.__typename = "Instance" return setmetatable(t, mt) end -- globals ------------------------------------------------------------- _G.typeof = function(v) if type(v) == "table" then local mt = getmetatable(v) if mt and mt.__typename then return mt.__typename end end if type(v) == "number" then return "number" end return type(v) end _G.math.clamp = function(v, lo, hi) if v < lo then return lo end if v > hi then return hi end return v end _G.table.find = function(t, v) for i = 1, #t do if t[i] == v then return i end end return nil end _G.Vector2 = { new = function() return stub("Vector2") end } _G.Vector3 = { new = function() return stub("Vector3") end, zero = stub("Vector3zero") } _G.CFrame = { new = function() return stub("CFrame") end, Angles = function() return stub("Angles") end, lookAt = function() return stub("lookAt") end } _G.Color3 = { new = function() return stub("Color3") end, fromRGB = function() return stub("Color3rgb") end, fromHSV = function() return stub("Color3hsv") end } _G.ColorSequence = { new = function() return stub("ColorSequence") end } _G.ColorSequenceKeypoint = { new = function() return stub("CSK") end } _G.NumberSequence = { new = function() return stub("NumberSequence") end } _G.NumberSequenceKeypoint = { new = function() return stub("NSK") end } _G.UDim = { new = function() return stub("UDim") end } _G.UDim2 = { new = function() return stub("UDim2") end, fromOffset = function() return stub("UDim2o") end, fromScale = function() return stub("UDim2s") end, } _G.TweenInfo = { new = function() return stub("TweenInfo") end } _G.RaycastParams = { new = function() return stub("RaycastParams") end } _G.Rect = { new = function() return stub("Rect") end } _G.Enum = stub("Enum") _G.Instance = { new = function() return stub("Instance") end } _G.Drawing = nil _G.gethui = function() return stub("hui") end _G.getgc = function() return {} end _G.hookmetamethod = function() return stub("old") end _G.newcclosure = function(f) return f end _G.getgenv = function() return _G end _G.getfenv = function() return _G end _G.fireproximityprompt = function() end _G.writefile = function() end _G.isfile = function() return false end _G.isfolder = function() return true end _G.makefolder = function() end _G.setfpscap = function() end _G.task = { spawn = function(fn) return fn end, wait = function() return 0 end, delay = function() return nil end, cancel = function() end, } _G.wait = function() return 0 end -- fake UI library ------------------------------------------------------ local ui = {} ui.__elements = {} local function element(kind, data) data = data or {} local e = { kind = kind, Value = data.Default, Items = {} } function e:Set(v) self.Value = v if type(data.Callback) == "function" then pcall(data.Callback, v) end end function e:SetText(t) self.Text = t end function e:SetVisibility(v) end function e:Get() return self.Value end function e:Refresh(list) self.List = list end e.Callback = data.Callback e.Name = data.Name function e:Colorpicker(d) return element("colorpicker", d) end function e:Keybind(d) return element("keybind", d) end ui.__elements[#ui.__elements + 1] = e return e end local function section(name) local s = { Name = name } function s:Toggle(d) local e = element("toggle", d) if type(d.Callback) == "function" then pcall(d.Callback, d.Default == true) end return e end function s:Slider(d) local e = element("slider", d) if type(d.Callback) == "function" and d.Default ~= nil then pcall(d.Callback, d.Default) end return e end function s:Dropdown(d) local e = element("dropdown", d) if type(d.Callback) == "function" and d.Default ~= nil then pcall(d.Callback, d.Default) end return e end function s:Button() local b = element("button") function b:Add(name, cb) local e = element("action") e.Name = name e.Callback = cb return e end return b end function s:Label(name) local e = element("label", {}) e.Text = name return e end function s:Textbox(d) local e = element("textbox", d) if type(d.Callback) == "function" and d.Default ~= nil then pcall(d.Callback, d.Default) end return e end return s end local function page(name) local p = { Name = name, Items = {} } p.Items.Icon = { Instance = stub("Icon") } function p:Section(d) return section(type(d) == "table" and d.Name or d) end function p:SubPage(d) return page(type(d) == "table" and d.Name or d) end return p end local function library() local lib = { Pages = {} } local window = { Pages = lib.Pages, IsOpen = true } window.Items = { MainFrame = { Instance = stub("MainFrame") } } function window:Page(d) local p = page(type(d) == "table" and d.Name or d) lib.Pages[#lib.Pages + 1] = p return p end function window:SetOpen(v) self.IsOpen = v end function window:SetBackgroundImage() end function lib:Window() return window end function lib:Watermark() return { Set = function() end } end function lib:KeybindList() return { Add = function() end } end function lib:Notify() end function lib:Notification() end function lib:Unload() end function lib:CreateSettingsPage(w) local p = page("Settings") p.Items.Icon = { Instance = stub("Icon") } lib.Pages[#lib.Pages + 1] = p return p end return lib end _G.__FAKE_LIBRARY = library() -- services ------------------------------------------------------------- local Players = stub("Players") local LocalPlayer = stub("LocalPlayer") LocalPlayer.Name = "Tester" LocalPlayer.DisplayName = "Tester" LocalPlayer.UserId = 1 LocalPlayer.Character = nil LocalPlayer.FindFirstChild = function(self, n) if n == "Backpack" then return stub("Backpack") end if n == "PlayerGui" then return stub("PlayerGui") end return stub("lp:" .. tostring(n)) end LocalPlayer.WaitForChild = function(self, n) return stub("lpw:" .. tostring(n)) end LocalPlayer.GetMouse = function() return stub("Mouse") end LocalPlayer.IsFriendsWith = function() return false end LocalPlayer.GetAttribute = function() return 0 end Players.LocalPlayer = LocalPlayer Players.GetPlayers = function() return {} end Players.PlayerAdded = stub("PlayerAdded") Players.PlayerRemoving = stub("PlayerRemoving") local Workspace = stub("Workspace") Workspace.CurrentCamera = stub("Camera") Workspace.GetDescendants = function() return {} end Workspace.GetChildren = function() return {} end Workspace.Raycast = function() return nil end Workspace.FindFirstChild = function() return nil end Workspace.DescendantAdded = stub("DescendantAdded") local RS = stub("ReplicatedStorage") _G.__connections = {} local function signal(name) local s = stub(name) s.Connect = function(self, fn) table.insert(_G.__connections, { name = name, fn = fn }) return stub("conn:" .. name) end return s end local RunService = stub("RunService") RunService.Heartbeat = signal("Heartbeat") RunService.RenderStepped = signal("RenderStepped") RunService.Stepped = signal("Stepped") RunService.BindToRenderStep = function() end RunService.UnbindFromRenderStep = function() end local UIS = stub("UserInputService") UIS.InputBegan = signal("InputBegan") UIS.InputEnded = signal("InputEnded") UIS.InputChanged = signal("InputChanged") UIS.TouchTap = signal("TouchTap") UIS.TouchEnabled = false UIS.KeyboardEnabled = true UIS.GetMouseLocation = function() return stub("ML") end UIS.IsKeyDown = function() return false end UIS.GetFocusedTextBox = function() return nil end local game = stub("game") game.PlaceId = 71600459831333 game.PlaceVersion = 1 game.IsLoaded = function() return true end game.HttpGet = function() return "return __FAKE_LIBRARY" end game.GetService = function(self, n) if n == "Players" then return Players end if n == "ReplicatedStorage" then return RS end if n == "RunService" then return RunService end if n == "UserInputService" then return UIS end if n == "Workspace" then return Workspace end if n == "Lighting" then return stub("Lighting") end return stub("svc:" .. tostring(n)) end game.Workspace = Workspace local env = setmetatable({ game = game, workspace = Workspace, Workspace = Workspace, loadstring = function(s) return load(s, "lib", "t", _G) end, print = print, warn = warn, error = error, pcall = pcall, select = select, type = type, pairs = pairs, ipairs = ipairs, next = next, rawget = rawget, rawset = rawset, setmetatable = setmetatable, getmetatable = getmetatable, tostring = tostring, tonumber = tonumber, unpack = table.unpack, }, { __index = _G }) local chunk, cerr = load(SRC, "slr", "t", env) if not chunk then print("[mock] COMPILE ERROR: " .. tostring(cerr)) return end print("[mock] running") local ok, err = pcall(chunk) print("[mock] load result:", ok, err) if ok then print("[mock] elements created: " .. tostring(#ui.__elements)) local failures = 0 for _, e in ipairs(ui.__elements) do if e.kind == "toggle" and e.Callback then local okT, errT = pcall(e.Callback, true) if not okT then failures = failures + 1 print("[mock] toggle fail", tostring(e.Name), errT) end end end for _, e in ipairs(ui.__elements) do if e.kind == "action" and e.Callback then local okA, errA = pcall(e.Callback) if not okA then failures = failures + 1 print("[mock] action fail", tostring(e.Name), errA) end end end print("[mock] callback failures: " .. tostring(failures)) for _, c in ipairs(_G.__connections or {}) do local okC, errC = pcall(c.fn) if not okC then print("[mock] signal fail", c.name, errC) end end local api = _G.SLR_Menu print("[mock] api:", type(api)) if type(api) == "table" then print("[mock] pages:", tostring(api.Pages and type(api.Pages.Main))) local ok2, err2 = pcall(function() api:Destroy() end) print("[mock] destroy:", ok2, err2) end end