--[[ PaCompat v3.0 - Universal Roblox Executor Compatibility Layer Provides cross-executor compatibility for various exploit functions GitHub: https://github.com/CoolExploit/TestLua/blob/main/pacompat Updated and maintained by CoolExploit Added saveinstance function Adeded getmemoryaddress function Added getobjects function Added loadstring function Added setreadonly/isreadonly/makereadonly/makewriteable functions --]] local stuff = {ver="3.0",exec="Unknown",missing={},caps={}} local function try(f,...)local s,r=pcall(f,...)return s and r or nil,r end local function getexec() if identifyexecutor then return try(identifyexecutor)end if getexecutorname then return try(getexecutorname)end end stuff.exec=getexec() local http=game:GetService("HttpService") local rs=game:GetService("RunService") local plrs=game:GetService("Players") local coregui=game:GetService("CoreGui") local uis=game:GetService("UserInputService") local ts=game:GetService("TweenService") local lighting=game:GetService("Lighting") local function mkguid()return http:GenerateGUID(false)end local function dummy(t) local n={} for k,v in pairs(t)do n[k]=function(...)return type(v)=="function"and v(...)or v end end return n end local impl={ identifyexecutor=function()return stuff.exec end, getexecutorname=function()return stuff.exec end, request=request or http_request or(syn and syn.request)or function(o) return{Success=false,StatusCode=0,StatusMessage="Not Supported",Headers={},Body=""} end, http_request=http_request or request or(syn and syn.request)or function(o)return impl.request(o)end, writefile=writefile or function(p,c) if not isfolder or not makefolder then return false end local dir=p:match("(.*/)") if dir and not isfolder(dir)then makefolder(dir)end return false end, readfile=readfile or function(p)return""end, appendfile=appendfile or function(p,c) if readfile and writefile then local old=try(readfile,p)or"" return writefile(p,old..c) end return false end, delfile=delfile or function(p)return false end, isfile=isfile or function(p)return false end, isfolder=isfolder or function(p)return false end, listfiles=listfiles or function(p)return{}end, makefolder=makefolder or function(p)return false end, delfolder=delfolder or function(p)return false end, getgenv=getgenv or function()return getfenv and getfenv(0)or _G end, getrenv=getrenv or function() return getfenv and getfenv(0)or{game=game,Game=game,workspace=workspace,Workspace=workspace, script=script,require=require,pcall=pcall,xpcall=xpcall,coroutine=coroutine, string=string,table=table,math=math} end, getsenv=getsenv or function(s) if getfenv and s and s:IsA("LocalScript")then return getfenv(s)end return getfenv and getfenv(2)or{} end, getfenv=getfenv,setfenv=setfenv, gethui=gethui or function()return coregui end, protectgui=protectgui or function(g) if g and g:IsA("GuiObject")then g.Name=mkguid() if g.Parent==coregui then g.Parent=nil;task.wait();g.Parent=coregui end end end, unprotectgui=unprotectgui or function(g)if g then g.Name=tostring(g)end end, getnilinstances=getnilinstances or function() local t={}for _,v in pairs(game:GetDescendants())do if not v.Parent then table.insert(t,v)end end return t end, getinstances=getinstances or function()return game:GetDescendants()end, cloneref=cloneref or function(o)return o end, compareinstances=compareinstances or function(a,b)return a==b end, getgc=getgc or function(inc) local t={}for _,v in pairs(_G)do if type(v)=="function"or(inc and type(v)=="table")then table.insert(t,v)end end return t end, getcallingscript=getcallingscript or function()return nil end, getscriptclosure=getscriptclosure or function(s)return nil end, getscripthash=getscripthash or function(s)return mkguid()end, getscriptbytecode=getscriptbytecode or function(s)return""end, getscripts=getscripts or function() local t={}for _,v in pairs(game:GetDescendants())do if v:IsA("LocalScript")or v:IsA("ModuleScript")then table.insert(t,v)end end return t end, getloadedmodules=getloadedmodules or function() local t={}for _,v in pairs(game:GetDescendants())do if v:IsA("ModuleScript")then table.insert(t,v)end end return t end, getrunningscripts=getrunningscripts or function() local t={}for _,v in pairs(game:GetDescendants())do if v:IsA("LocalScript")and v.Enabled then table.insert(t,v)end end return t end, hookfunction=hookfunction or function(o,n)return o end, hookmetamethod=hookmetamethod or function(o,m,h)return function(...)return h(...)end end, restorefunction=restorefunction or function(f)return f end, getnamecallmethod=getnamecallmethod or function()return""end, iscclosure=iscclosure or function(f)return false end, islclosure=islclosure or function(f)return type(f)=="function"end, newcclosure=newcclosure or function(f)return f end, getconstants=getconstants or function(f)return{}end, getconstant=getconstant or function(f,i)return nil end, setconstant=setconstant or function(f,i,v)end, getupvalues=getupvalues or function(f)return{}end, getupvalue=getupvalue or function(f,i)return nil end, setupvalue=setupvalue or function(f,i,v)end, getproto=getproto or function(f,i)return nil end, getprotos=getprotos or function(f)return{}end, getstack=getstack or function(l,i)return nil end, setstack=setstack or function(l,i,v)end, checkcaller=checkcaller or function()return rs:IsStudio()end, getconnections=getconnections or function(s)return{}end, firesignal=firesignal or function(s,...)if s and s.Fire then s:Fire(...)end end, fireclickdetector=fireclickdetector or function(cd,d) if cd and cd.Parent then local c=plrs.LocalPlayer and plrs.LocalPlayer.Character if c and c:FindFirstChild("HumanoidRootPart")then local old=c.HumanoidRootPart.CFrame c.HumanoidRootPart.CFrame=cd.Parent.CFrame task.wait() cd.MouseClick:Fire() c.HumanoidRootPart.CFrame=old end end end, getcallbackvalue=getcallbackvalue or function(cd) return cd and cd.MaxActivationDistance or 32 end, firetouchinterest=firetouchinterest or function(p1,p2,t) if p1 and p2 then local old=p1.CFrame p1.CFrame=p2.CFrame task.wait() p1.CFrame=old end end, fireproximityprompt=fireproximityprompt or function(pp,a,s) if pp then pp.Enabled=true pp:InputHoldBegin() task.wait(pp.HoldDuration or 0.5) pp:InputHoldEnd() end end, getcustomasset=getcustomasset or function(p)return"rbxasset://"..p end, getsynasset=getsynasset or getcustomasset, setclipboard=setclipboard or toclipboard or function(t)return false end, toclipboard=toclipboard or setclipboard, queue_on_teleport=queue_on_teleport or(syn and syn.queue_on_teleport)or function(c)end, queueonteleport=queueonteleport or queue_on_teleport, isnetworkowner=isnetworkowner or function(p) return p and p:IsDescendantOf(plrs.LocalPlayer.Character) end, gethiddenproperty=gethiddenproperty or function(o,p) if typeof(o) == "Instance" and type(p) == "string" then local ok, result = pcall(function() return o[p] end) if ok then return result end end return nil end, sethiddenproperty=sethiddenproperty or function(o,p,v) if typeof(o) == "Instance" and type(p) == "string" then pcall(function() o[p] = v end) end end, getrawmetatable = getrawmetatable or function(o) local ok, mt = pcall(getmetatable, o) if ok then return mt end return nil end, setrawmetatable = setrawmetatable or function(o, mt) local ok = pcall(setmetatable, o, mt) return ok end, setreadonly=setreadonly or function(t,r) if type(t) == "table" then rawset(t, "__readonly", r) end end, isreadonly=isreadonly or function(t) if type(t) == "table" then return rawget(t, "__readonly") or false end return false end, makereadonly=makereadonly or setreadonly or function(t) if type(t) == "table" then rawset(t, "__readonly", true) end end, makewriteable=makewriteable or function(t) if type(t) == "table" then rawset(t, "__readonly", false) end end, Drawing=Drawing or dummy({new=function(t)return dummy({Remove=function()end,Visible=true,Color=Color3.new(1,1,1),Transparency=1,Thickness=1,From=Vector2.new(),To=Vector2.new()})end}), WebSocket=WebSocket or dummy({ connect=function(u)return dummy({Send=function(d)end,Close=function()end,OnMessage=function()end,OnClose=function()end})end }), crypt=crypt or dummy({ base64encode=function(s)return s end,base64decode=function(s)return s end, base64_encode=function(s)return s end,base64_decode=function(s)return s end, encrypt=function(s,k)return s end,decrypt=function(s,k)return s end, hash=function(s)return s end, generatekey=function()return mkguid()end, generatebytes=function(n)return string.rep("a",n or 32)end }), getmemoryaddress=getmemoryaddress or function(o) getmemoryaddress = getmemoryaddress or (function() local cache = setmetatable({}, {__mode = "kv"}) local byte, sub, find, lower = string.byte, string.sub, string.find, string.lower local format = string.format local function isHex(s) for i = 1, #s do local b = byte(s, i) if not ((b >= 48 and b <= 57) or (b >= 65 and b <= 70) or (b >= 97 and b <= 102)) then return false end end return true end return function(o) if o == nil then return "0x0" end local result = cache[o] if result then return result end local str = tostring(o) local len = #str if len < 3 then cache[o] = "0x0" return "0x0" end local start, finish start, finish = find(str, "0x", 1, true) if start then local addr = sub(str, finish + 1) if #addr >= 1 and isHex(addr) then result = "0x" .. lower(addr) cache[o] = result return result end end start, finish = find(str, ": ", 1, true) if start then local remainder = sub(str, finish + 1) if sub(remainder, 1, 2) == "0x" then local addr = sub(remainder, 3) if #addr >= 1 and isHex(addr) then result = "0x" .. lower(addr) cache[o] = result return result end else if #remainder >= 8 and isHex(remainder) then result = "0x" .. lower(remainder) cache[o] = result return result end end end if len >= 8 and isHex(str) then result = "0x" .. lower(str) cache[o] = result return result end cache[o] = "0x0" return "0x0" end)() end, schedule = schedule or task.schedule or task.defer or function(f,...)task.spawn(f,...)end, getthreadidentity = getthreadidentity or getidentity or function()return 7 end, setthreadidentity = setthreadidentity or setidentity or function(i)end, getidentity = getidentity or getthreadidentity or function()return 7 end, setidentity = setidentity or setthreadidentity or function(i)end, getnamedhookfunction = getnamedhookfunction or function(n)return nil end, getinfo = getinfo or debug.getinfo or function(f)return{}end, getrenderproperty = getrenderproperty or function(o,p)return nil end, setrenderproperty = setrenderproperty or function(o,p,v)end, cleardrawcache = cleardrawcache or function()end, isrenderobj = isrenderobj or function(o)return false end, getobjects = getobjects or function(id) if not id or type(id) ~= "string" then return {} end local assetId = id if not id:match("^rbxassetid://") and not id:match("^http") then assetId = "rbxassetid://" .. id end local success, result = pcall(function() return game:GetObjects(assetId) end) if success then return result else local fallbackSuccess, fallbackResult = pcall(function() local insertService = game:GetService("InsertService") return {insertService:LoadAsset(tonumber(id:match("%d+") or 0))} end) return fallbackSuccess and fallbackResult or {} end end, loadstring = loadstring or function(s, n) if type(s) ~= "string" then return nil, "bad argument #1 to 'loadstring' (string expected)" end local chunkname = nil local env = nil if type(n) == "string" then chunkname = n elseif type(n) == "table" then env = n end local fn, err = load and load(s, chunkname or "=(loadstring)") or nil, "load not available" if not fn then fn, err = loadstring(s, chunkname) else return nil, err or "no loader available" end end if env and type(env) == "table" then if setfenv then pcall(setfenv, fn, env) else pcall(function() local i = 1 while true do local name = debug.getupvalue(fn, i) if not name then break end if name == "_ENV" then debug.setupvalue(fn, i, env) break end i = i + 1 end end) end end return fn, nil end, saveinstance=saveinstance or function(o) if not obj or typeof(obj) ~= "Instance" then return nil, "bad argument #1 (Instance expected, got " .. typeof(obj) .. ")" end local function serializeValue(v, depth) depth = depth or 0 if depth > 10 then return "[max depth reached]" end local t = typeof(v) if t == "string" then return ("%q"):format(v:gsub("[\0-\31]", function(c) return "\\" .. c:byte() end)) elseif t == "number" then return tostring(v) elseif t == "boolean" then return tostring(v) elseif t == "nil" then return "nil" end if t == "Instance" then return {__inst = true, Class = v.ClassName, Name = v.Name, Path = v:GetFullName()} end if t == "Vector3" then return {__vec3 = true, x = v.X, y = v.Y, z = v.Z} end if t == "Vector2" then return {__vec2 = true, x = v.X, y = v.Y} end if t == "Vector3int16" then return {__vec3i16 = true, x = v.X, y = v.Y, z = v.Z} end if t == "CFrame" then local x, y, z, r00, r01, r02, r10, r11, r12, r20, r21, r22 = v:GetComponents() return {__cframe = true, components = {x, y, z, r00, r01, r02, r10, r11, r12, r20, r21, r22}} end if t == "Color3" then return {__color3 = true, r = v.R, g = v.G, b = v.B} end if t == "BrickColor" then return {__brickcolor = true, number = v.Number, name = v.Name} end if t == "NumberRange" then return {__numrange = true, min = v.Min, max = v.Max} end if t == "NumberSequence" then local keypoints = {} for i, k in ipairs(v.Keypoints) do table.insert(keypoints, {t = k.Time, v = k.Value, nd = k.Envelope}) end return {__numsequence = true, keypoints = keypoints} end if t == "ColorSequence" then local keypoints = {} for i, k in ipairs(v.Keypoints) do table.insert(keypoints, { t = k.Time, v = {r = k.Value.R, g = k.Value.G, b = k.Value.B} }) end return {__colorsequence = true, keypoints = keypoints} end if t == "UDim" then return {__udim = true, scale = v.Scale, offset = v.Offset} end if t == "UDim2" then return {__udim2 = true, x = {scale = v.X.Scale, offset = v.X.Offset}, y = {scale = v.Y.Scale, offset = v.Y.Offset}} end if t == "Rect" then return {__rect = true, min = {x = v.Min.X, y = v.Min.Y}, max = {x = v.Max.X, y = v.Max.Y}} end if t == "EnumItem" then return {__enum = true, type = tostring(v.EnumType), value = v.Value} end if t == "table" then local serialized = {__table = true} for key, value in pairs(v) do serialized[key] = serializeValue(value, depth + 1) end return serialized end return {__unsupported = true, type = t, value = tostring(v)} end local function serializeInstance(node, seen) seen = seen or {} if seen[node] then return {__duplicate = true, path = node:GetFullName()} end seen[node] = true local t = { Name = node.Name, ClassName = node.ClassName, Path = node:GetFullName(), Attributes = {}, Properties = {}, Children = {} } local ok, attrs = pcall(function() return node:GetAttributes() end) if ok and attrs then for attr, value in pairs(attrs) do t.Attributes[attr] = serializeValue(value) end end local propertyBlacklist = { "Parent", "Archivable" } local function isBlacklisted(prop) for _, blackProp in ipairs(propertyBlacklist) do if prop == blackProp then return true end end return false end local commonProps = { "Transparency", "Locked", "CanCollide", "Anchored", "Size", "Position", "CFrame", "Orientation", "BrickColor", "Color", "Text", "TextSize", "Value", "Image", "Material", "Reflectance", "Shape", "FormFactor", "Backend", "Source", "LinkedSource" } for _, prop in ipairs(commonProps) do if not isBlacklisted(prop) then local okv, val = pcall(function() return node[prop] end) if okv and val ~= nil then t.Properties[prop] = serializeValue(val) end end end if pcall(function() return node.GetProperties end) then local success, properties = pcall(function() local props = {} for _, prop in ipairs(node:GetProperties()) do if not isBlacklisted(prop.Name) then local ok, value = pcall(function() return node[prop.Name] end) if ok and value ~= nil then props[prop.Name] = serializeValue(value) end end end return props end) if success then for prop, value in pairs(properties) do t.Properties[prop] = value end end end local childCount = 0 local maxChildren = 100000 for _, child in ipairs(node:GetChildren()) do if childCount < maxChildren then local serializedChild = serializeInstance(child, seen) table.insert(t.Children, serializedChild) childCount = childCount + 1 else table.insert(t.Children, {__truncated = true, reason = "max children exceeded"}) break end end return t end local root = serializeInstance(obj) local function generateFilename() local baseName = ("saved_%s_%s"):format( obj.ClassName:gsub("[^%w_]", "_"), obj.Name:gsub("[^%w_]", "_") ) if http and http.GenerateGUID then local ok, guid = pcall(function() return http:GenerateGUID(false) end) if ok then return baseName .. "_" .. guid .. ".json" end end return baseName .. "_" .. tostring(os.time()) .. ".json" end local filename = generateFilename() local encoded, encodingError = nil, nil if http and http.JSONEncode then local success, result = pcall(function() return http:JSONEncode(root, true) end) if success then encoded = result else encodingError = result encoded = tostring(root) end else encoded = tostring(root) end if writefile then local success, err = pcall(function() writefile(filename, encoded) end) if success then _saved_instances = _saved_instances or {} _saved_instances[filename] = root return filename, "success" else return nil, "file write failed: " .. tostring(err) end end _saved_instances = _saved_instances or {} _saved_instances[filename] = root return filename, "memory_only" end, messagebox=messagebox or function(t,c,b)print(t,c)end, mouse1click=mouse1click or function(x,y) local vp=workspace.CurrentCamera.ViewportSize uis.InputBegan:Fire({UserInputType=Enum.UserInputType.MouseButton1,Position=Vector2.new(x or vp.X/2,y or vp.Y/2)}) task.wait() uis.InputEnded:Fire({UserInputType=Enum.UserInputType.MouseButton1}) end, mouse1press=mouse1press or function(x,y) local vp=workspace.CurrentCamera.ViewportSize uis.InputBegan:Fire({UserInputType=Enum.UserInputType.MouseButton1,Position=Vector2.new(x or vp.X/2,y or vp.Y/2)}) end, mouse1release=mouse1release or function() uis.InputEnded:Fire({UserInputType=Enum.UserInputType.MouseButton1}) end, mouse2click=mouse2click or function(x,y) local vp=workspace.CurrentCamera.ViewportSize uis.InputBegan:Fire({UserInputType=Enum.UserInputType.MouseButton2,Position=Vector2.new(x or vp.X/2,y or vp.Y/2)}) task.wait() uis.InputEnded:Fire({UserInputType=Enum.UserInputType.MouseButton2}) end, mouse2press=mouse2press or function(x,y) local vp=workspace.CurrentCamera.ViewportSize uis.InputBegan:Fire({UserInputType=Enum.UserInputType.MouseButton2,Position=Vector2.new(x or vp.X/2,y or vp.Y/2)}) end, mouse2release=mouse2release or function() uis.InputEnded:Fire({UserInputType=Enum.UserInputType.MouseButton2}) end, mousemoveabs=mousemoveabs or function(x,y)end, mousemoverel=mousemoverel or function(x,y)end, mousescroll=mousescroll or function(d)end, keypress=keypress or function(k) uis.InputBegan:Fire({KeyCode=Enum.KeyCode[k],UserInputType=Enum.UserInputType.Keyboard}) end, keyrelease=keyrelease or function(k) uis.InputEnded:Fire({KeyCode=Enum.KeyCode[k],UserInputType=Enum.UserInputType.Keyboard}) end, isrbxactive=isrbxactive or function()return uis.WindowFocused end, isgameactive=isgameactive or isrbxactive or function()return uis.WindowFocused end, getspecialinfo=getspecialinfo or function(o)return{}end, setscriptable=setscriptable or function(o,p,v)end, isscriptable=isscriptable or function(o,p)return true end, getproperties=getproperties or function(o)return{}end, gethiddenproperties=gethiddenproperties or function(o)return{}end, setsimulationradius=setsimulationradius or function(r,mr) if plrs.LocalPlayer then plrs.LocalPlayer.MaximumSimulationRadius=mr or 1000 plrs.LocalPlayer.SimulationRadius=r or 1000 end end, getsimulationradius=getsimulationradius or function() return plrs.LocalPlayer and plrs.LocalPlayer.SimulationRadius or 0 end, setfpscap=setfpscap or function(c)end, getfpscap=getfpscap or function()return 60 end, getrenderproperty=getrenderproperty or function(i,p)return nil end, setrenderproperty=setrenderproperty or function(i,p,v)end, getnamecallmethod=getnamecallmethod or function()return""end, isexecutorclosure=isexecutorclosure or function(f)return false end, isuntouched=isuntouched or function(f)return true end, islsynapsefunction=islsynapsefunction or isexecutorclosure or function(f)return false end, isourclosure=isourclosure or islclosure or function(f)return type(f)=="function"end, checkcaller=checkcaller or function()return false end, getallmethodnames=getallmethodnames or function(c) local m={} for _,v in pairs(game:GetService(c):GetChildren())do if type(v)=="function"then table.insert(m,tostring(v))end end return m end, getmethodnames=getmethodnames or getallmethodnames, fireasyncfunction=fireasyncfunction or function(f,...)return f(...)end } for k,v in pairs(impl)do if not _G[k]then _G[k]=v else table.insert(stuff.missing,k)end end stuff.caps={ http=request~=nil or http_request~=nil or(syn and syn.request~=nil), files=writefile~=nil and readfile~=nil, hooks=hookfunction~=nil, draw=Drawing~=nil and Drawing.new~=nil, ws=WebSocket~=nil and WebSocket.connect~=nil, hidden=gethiddenproperty~=nil, clone=cloneref~=nil, scripts=getscriptclosure~=nil, closures=getconstants~=nil or getupvalues~=nil, signals=getconnections~=nil, clip=setclipboard~=nil, tp=queue_on_teleport~=nil, crypto=crypt~=nil, memory=getmemoryaddress~=nil, input=mouse1click~=nil or keypress~=nil, simulation=setsimulationradius~=nil } _G.CompatStuff=stuff if #stuff.missing>0 and writefile then try(writefile,"compat_missing.txt",table.concat(stuff.missing,"\n")) end return setmetatable(stuff,{ __tostring=function(s)return string.format("compat[%s|%s]",s.ver,s.exec)end, __call=function(s,fn,...)if impl[fn]then return try(impl[fn],...)end return nil end })