local ok, result = pcall(function() return game:GetService'HttpService':JSONDecode(game:HttpGet'https://raw.githubusercontent.com/MaximumADHD/Roblox-Client-Tracker/roblox/Mini-API-Dump.json') end) dump = ok and result or {Classes={}} classprops = {} superclass = {} proptypes = {} for _, class in ipairs(dump.Classes) do superclass[class.Name] = class.Superclass classprops[class.Name] = {} proptypes[class.Name] = {} for _, member in ipairs(class.Members) do if member.MemberType == 'Property' then local tags = member.Tags or {} local skip = false for _, tag in ipairs(tags) do if tag == 'NotScriptable' or tag == 'ReadOnly' then skip = true break end end if not skip then table.insert(classprops[class.Name], member.Name) proptypes[class.Name][member.Name] = member.ValueType and member.ValueType.Name or 'unknown' end end end end local CFRAME_IDS = {} local CFRAME_ROTS = {} do local special = { [0x02]=CFrame.new(), [0x03]=CFrame.Angles(math.rad(90),0,0), [0x05]=CFrame.Angles(0,math.rad(180),math.rad(180)), [0x06]=CFrame.Angles(math.rad(-90),0,0), [0x07]=CFrame.Angles(0,math.rad(180),math.rad(90)), [0x09]=CFrame.Angles(0,math.rad(90),math.rad(90)), [0x0a]=CFrame.Angles(0,0,math.rad(90)), [0x0c]=CFrame.Angles(0,math.rad(-90),math.rad(90)), [0x0d]=CFrame.Angles(math.rad(-90),math.rad(-90),0), [0x0e]=CFrame.Angles(0,math.rad(-90),0), [0x10]=CFrame.Angles(math.rad(90),math.rad(-90),0), [0x11]=CFrame.Angles(0,math.rad(90),math.rad(180)), [0x14]=CFrame.Angles(0,math.rad(180),0), [0x15]=CFrame.Angles(math.rad(-90),math.rad(-180),0), [0x17]=CFrame.Angles(0,0,math.rad(180)), [0x18]=CFrame.Angles(math.rad(90),math.rad(180),0), [0x19]=CFrame.Angles(0,0,math.rad(-90)), [0x1b]=CFrame.Angles(0,math.rad(-90),math.rad(-90)), [0x1c]=CFrame.Angles(0,math.rad(-180),math.rad(-90)), [0x1e]=CFrame.Angles(0,math.rad(90),math.rad(-90)), [0x1f]=CFrame.Angles(math.rad(90),math.rad(90),0), [0x20]=CFrame.Angles(0,math.rad(90),0), [0x22]=CFrame.Angles(math.rad(-90),math.rad(90),0), [0x23]=CFrame.Angles(0,math.rad(-90),math.rad(180)), } local function rotkey(cf) local c={cf:GetComponents()} local parts={} for i=4,12 do table.insert(parts,string.format('%d',math.floor(c[i]+0.5))) end return table.concat(parts,',') end for id,cf in pairs(special) do CFRAME_IDS[rotkey(cf)]=id local c={cf:GetComponents()} CFRAME_ROTS[id]={c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12]} end function getcframeid(cf) local c={cf:GetComponents()} local parts={} for i=4,12 do table.insert(parts,string.format('%d',math.floor(c[i]+0.5))) end return CFRAME_IDS[table.concat(parts,',')] end end function writeu8(buf,v) table.insert(buf,string.char(math.floor(v)%256)) end function writeu16le(buf,v) v=math.floor(v)%65536 table.insert(buf,string.char(v%256,math.floor(v/256)%256)) end function writeu32le(buf,v) v=math.floor(v)%4294967296 table.insert(buf,string.char(v%256,math.floor(v/256)%256,math.floor(v/65536)%256,math.floor(v/16777216)%256)) end function writei32le(buf,v) if v<0 then v=v+4294967296 end writeu32le(buf,v) end function writef32le(buf,v) if v~=v then writeu32le(buf,0) return end if v==0 then writeu32le(buf,0) return end local sign=0 if v<0 then sign=1 v=-v end if v==math.huge then writeu32le(buf,sign*2^31+255*2^23) return end local exp=math.floor(math.log(v)/math.log(2)) local mantissa=v/2^exp-1 if mantissa<0 then mantissa=0 end if mantissa>=1 then mantissa=1-1/2^23 end exp=exp+127 if exp<=0 then exp=0 elseif exp>=255 then exp=255 end writeu32le(buf,math.floor(sign*2^31+exp*2^23+math.floor(mantissa*2^23+0.5))%4294967296) end function writestring(buf,s) table.insert(buf,s) end function writelenstring(buf,s) writeu32le(buf,#s) table.insert(buf,s) end function robloxfloat(v) if v~=v then return 0 end if v==0 then return 0 end local sign=0 if v<0 then sign=1 v=-v end if v==math.huge then local bits=(sign*2^31+255*2^23)%4294967296 local r=(bits*2)%4294967296 if bits>=2147483648 then r=r+1 end return math.floor(r) end local exp=math.floor(math.log(v)/math.log(2)) local mantissa=v/2^exp-1 if mantissa<0 then mantissa=0 end if mantissa>=1 then mantissa=1-1/2^23 end exp=exp+127 if exp<=0 then exp=0 elseif exp>=255 then exp=255 end local bits=(sign*2^31+exp*2^23+math.floor(mantissa*2^23+0.5))%4294967296 local r=(bits*2)%4294967296 if bits>=2147483648 then r=r+1 end return math.floor(r) end function zigzag(v) v=math.floor(v) if v>=0 then return v*2 else return(-v)*2-1 end end function interleave(ints) local n=#ints local b={} for i=1,n do local v=math.floor(ints[i])%4294967296 b[i]=math.floor(v/16777216)%256 b[i+n]=math.floor(v/65536)%256 b[i+n*2]=math.floor(v/256)%256 b[i+n*3]=v%256 end local chars={} for _,byte in ipairs(b) do table.insert(chars,string.char(byte)) end return table.concat(chars) end function interleaveints(ints) local zz={} for _,v in ipairs(ints) do table.insert(zz,zigzag(v)) end return interleave(zz) end function encodereferents(refs) local deltas={} local prev=0 for _,r in ipairs(refs) do table.insert(deltas,r-prev) prev=r end return interleaveints(deltas) end function makechunk(tag,data) local raw=table.concat(data) local compressed=lz4compress(raw) local buf={} writestring(buf,tag..string.rep('\0',4-#tag)) writeu32le(buf,#compressed) writeu32le(buf,#raw) writeu32le(buf,0) writestring(buf,compressed) return table.concat(buf) end function makerawchunk(tag,data) local raw=table.concat(data) local buf={} writestring(buf,tag..string.rep('\0',4-#tag)) writeu32le(buf,0) writeu32le(buf,#raw) writeu32le(buf,0) writestring(buf,raw) return table.concat(buf) end function collectinstances(root) local instances={} local referents={} local id=-1 local function walk(inst) id=id+1 referents[inst]=id table.insert(instances,inst) for _,child in ipairs(inst:GetChildren()) do walk(child) end end walk(root) return instances,referents end function groupbyclassname(instances) local classgroups={} local classorder={} local classseen={} for _,inst in ipairs(instances) do local cn=inst.ClassName if not classseen[cn] then classseen[cn]=true table.insert(classorder,cn) classgroups[cn]={typeid=#classorder-1,instances={}} end table.insert(classgroups[cn].instances,inst) end return classgroups,classorder end function makeinstchunks(classgroups,classorder,referents) local chunks={} for _,cn in ipairs(classorder) do local group=classgroups[cn] local buf={} writeu32le(buf,group.typeid) writelenstring(buf,cn) writeu8(buf,0) writeu32le(buf,#group.instances) local refs={} for _,inst in ipairs(group.instances) do table.insert(refs,referents[inst]) end writestring(buf,encodereferents(refs)) table.insert(chunks,makechunk('INST',buf)) end return chunks end function getproptype(classname,propname) local current=classname while current do if proptypes[current] and proptypes[current][propname] then return proptypes[current][propname] end current=superclass[current] end return nil end function encodepropvalue(vals,typename) local t=typeof(vals[1]) if t=='string' then if typename=='Content' then return 0x1D,function(buf) for _,v in ipairs(vals) do writelenstring(buf,tostring(v)) end end end return 0x01,function(buf) for _,v in ipairs(vals) do writelenstring(buf,tostring(v)) end end elseif t=='boolean' then return 0x02,function(buf) for _,v in ipairs(vals) do writeu8(buf,v and 1 or 0) end end elseif t=='number' then if typename=='int' or typename=='int64' then return 0x03,function(buf) local ints={} for _,v in ipairs(vals) do table.insert(ints,math.floor(v)) end writestring(buf,interleaveints(ints)) end else return 0x04,function(buf) local floats={} for _,v in ipairs(vals) do table.insert(floats,robloxfloat(v)) end writestring(buf,interleave(floats)) end end elseif t=='UDim' then return 0x06,function(buf) local scales,offsets={},{} for _,v in ipairs(vals) do table.insert(scales,robloxfloat(v.Scale)) table.insert(offsets,math.floor(v.Offset)) end writestring(buf,interleave(scales)) writestring(buf,interleaveints(offsets)) end elseif t=='UDim2' then return 0x07,function(buf) local xs,ys,xo,yo={},{},{},{} for _,v in ipairs(vals) do table.insert(xs,robloxfloat(v.X.Scale)) table.insert(ys,robloxfloat(v.Y.Scale)) table.insert(xo,math.floor(v.X.Offset)) table.insert(yo,math.floor(v.Y.Offset)) end writestring(buf,interleave(xs)) writestring(buf,interleave(ys)) writestring(buf,interleaveints(xo)) writestring(buf,interleaveints(yo)) end elseif t=='Ray' then return 0x08,function(buf) for _,v in ipairs(vals) do writef32le(buf,v.Origin.X) writef32le(buf,v.Origin.Y) writef32le(buf,v.Origin.Z) writef32le(buf,v.Direction.X) writef32le(buf,v.Direction.Y) writef32le(buf,v.Direction.Z) end end elseif t=='Faces' then return 0x09,function(buf) for _,v in ipairs(vals) do local b=0 if v.Front then b=b+1 end if v.Bottom then b=b+2 end if v.Left then b=b+4 end if v.Back then b=b+8 end if v.Top then b=b+16 end if v.Right then b=b+32 end writeu8(buf,b) end end elseif t=='Axes' then return 0x0A,function(buf) for _,v in ipairs(vals) do local b=0 if v.X then b=b+1 end if v.Y then b=b+2 end if v.Z then b=b+4 end writeu8(buf,b) end end elseif t=='BrickColor' then return 0x0B,function(buf) local nums={} for _,v in ipairs(vals) do table.insert(nums,v.Number) end writestring(buf,interleave(nums)) end elseif t=='Color3' then if typename=='Color3uint8' then return 0x1A,function(buf) local rs,gs,bs={},{},{} for _,v in ipairs(vals) do table.insert(rs,math.floor(v.R*255+0.5)) table.insert(gs,math.floor(v.G*255+0.5)) table.insert(bs,math.floor(v.B*255+0.5)) end for _,r in ipairs(rs) do writeu8(buf,r) end for _,g in ipairs(gs) do writeu8(buf,g) end for _,b in ipairs(bs) do writeu8(buf,b) end end else return 0x0C,function(buf) local rs,gs,bs={},{},{} for _,v in ipairs(vals) do table.insert(rs,robloxfloat(v.R)) table.insert(gs,robloxfloat(v.G)) table.insert(bs,robloxfloat(v.B)) end writestring(buf,interleave(rs)) writestring(buf,interleave(gs)) writestring(buf,interleave(bs)) end end elseif t=='Vector2' then return 0x0D,function(buf) local xs,ys={},{} for _,v in ipairs(vals) do table.insert(xs,robloxfloat(v.X)) table.insert(ys,robloxfloat(v.Y)) end writestring(buf,interleave(xs)) writestring(buf,interleave(ys)) end elseif t=='Vector3' then return 0x0E,function(buf) local xs,ys,zs={},{},{} for _,v in ipairs(vals) do table.insert(xs,robloxfloat(v.X)) table.insert(ys,robloxfloat(v.Y)) table.insert(zs,robloxfloat(v.Z)) end writestring(buf,interleave(xs)) writestring(buf,interleave(ys)) writestring(buf,interleave(zs)) end elseif t=='CFrame' then return 0x10,function(buf) local xs,ys,zs={},{},{} for _,v in ipairs(vals) do local id=getcframeid(v) if id then writeu8(buf,id) else local c={v:GetComponents()} writeu8(buf,0) for i=4,12 do writef32le(buf,c[i]) end end table.insert(xs,robloxfloat(v.X)) table.insert(ys,robloxfloat(v.Y)) table.insert(zs,robloxfloat(v.Z)) end writestring(buf,interleave(xs)) writestring(buf,interleave(ys)) writestring(buf,interleave(zs)) end elseif t=='EnumItem' then return 0x12,function(buf) local nums={} for _,v in ipairs(vals) do table.insert(nums,v.Value) end writestring(buf,interleave(nums)) end elseif t=='Instance' then return 0x13,function(buf) local refs={} for _ in ipairs(vals) do table.insert(refs,-1) end writestring(buf,encodereferents(refs)) end elseif t=='Vector3int16' then return 0x14,function(buf) for _,v in ipairs(vals) do local function wi16(n) n=math.floor(n) if n<0 then n=n+65536 end table.insert(buf,string.char(n%256,math.floor(n/256)%256)) end wi16(v.X) wi16(v.Y) wi16(v.Z) end end elseif t=='NumberSequence' then return 0x15,function(buf) for _,v in ipairs(vals) do writeu32le(buf,#v.Keypoints) for _,kf in ipairs(v.Keypoints) do writef32le(buf,kf.Time) writef32le(buf,kf.Value) writef32le(buf,kf.Envelope) end end end elseif t=='ColorSequence' then return 0x16,function(buf) for _,v in ipairs(vals) do writeu32le(buf,#v.Keypoints) for _,kf in ipairs(v.Keypoints) do writef32le(buf,kf.Time) writef32le(buf,kf.Value.R) writef32le(buf,kf.Value.G) writef32le(buf,kf.Value.B) writef32le(buf,0) end end end elseif t=='NumberRange' then return 0x17,function(buf) for _,v in ipairs(vals) do writef32le(buf,v.Min) writef32le(buf,v.Max) end end elseif t=='Rect' then return 0x18,function(buf) local x0s,y0s,x1s,y1s={},{},{},{} for _,v in ipairs(vals) do table.insert(x0s,robloxfloat(v.Min.X)) table.insert(y0s,robloxfloat(v.Min.Y)) table.insert(x1s,robloxfloat(v.Max.X)) table.insert(y1s,robloxfloat(v.Max.Y)) end writestring(buf,interleave(x0s)) writestring(buf,interleave(y0s)) writestring(buf,interleave(x1s)) writestring(buf,interleave(y1s)) end elseif t=='PhysicalProperties' then return 0x19,function(buf) for _ in ipairs(vals) do writeu8(buf,1) end end else return nil,nil end end local hadtodothis={ SoundId=true,MeshId=true,TextureID=true,TextureId=true, Texture=true,Image=true,TopImage=true,MidImage=true,BottomImage=true, LinkedSource=true,AnimationId=true,VideoId=true,ContentId=true, } local skippityskip={ AssemblyAngularVelocity=true,AssemblyCenterOfMass=true,AssemblyLinearVelocity=true, AssemblyMass=true,AssemblyRootPart=true,CenterOfMass=true,CurrentPhysicalProperties=true, ExtentsCFrame=true,ExtentsSize=true,Orientation=true,Position=true,Rotation=true, SpecificGravity=true,UniqueId=true,DataCost=true,ClassName=true,className=true, archivable=true,brickColor=true,formFactor=true,ReceiveAge=true,LocalTransparencyModifier=true, } function makepropchunks(classgroups,classorder) local chunks={} for _,cn in ipairs(classorder) do local group=classgroups[cn] local instances=group.instances local typeid=group.typeid local allprops={} local propseen={} local cur=cn while cur do if classprops[cur] then for _,p in ipairs(classprops[cur]) do if not propseen[p] and not skippityskip[p] then propseen[p]=true table.insert(allprops,p) end end end cur=superclass[cur] end for _,prop in ipairs(allprops) do local vals={} local ok=true for _,inst in ipairs(instances) do local s,v=pcall(function() return (inst::any)[prop] end) if not s or v==nil then ok=false break end table.insert(vals,v) end if ok and #vals>0 then local pt=getproptype(cn,prop) local proptype,encoder=encodepropvalue(vals,pt) if encoder then local buf={} writeu32le(buf,typeid) writelenstring(buf,prop) writeu8(buf,proptype) encoder(buf) table.insert(chunks,makechunk('PROP',buf)) end end end end return chunks end function makeprntchunk(instances,referents) local buf={} writeu8(buf,0) writeu32le(buf,#instances) local childrefs,parentrefs={},{} for _,inst in ipairs(instances) do table.insert(childrefs,referents[inst]) local par=inst.Parent table.insert(parentrefs,(par and referents[par]~=nil) and referents[par] or -1) end writestring(buf,encodereferents(childrefs)) writestring(buf,encodereferents(parentrefs)) return makechunk('PRNT',buf) end function tobinary(instance) local insts,refs=collectinstances(instance) local groups,order=groupbyclassname(insts) local out={} writestring(out,''})) return table.concat(out) end function readu8(data,pos) return string.byte(data,pos),pos+1 end function readu16le(data,pos) local a,b=string.byte(data,pos,pos+1) return a+b*256,pos+2 end function readu32le(data,pos) local a,b,c,d=string.byte(data,pos,pos+3) return a+b*256+c*65536+d*16777216,pos+4 end function readi32le(data,pos) local v,p=readu32le(data,pos) if v>=2147483648 then v=v-4294967296 end return v,p end function readf32le(data,pos) local bits,p=readu32le(data,pos) if bits==0 then return 0,p end local sign=math.floor(bits/2^31) local exp=math.floor(bits/2^23)%256 local mantissa=bits%2^23 if exp==0 then return 0,p end if exp==255 then return(sign==1 and -math.huge or math.huge),p end local v=(1+mantissa/2^23)*2^(exp-127) if sign==1 then v=-v end return v,p end function readlenstring(data,pos) local len,p=readu32le(data,pos) return data:sub(p,p+len-1),p+len end function deinterleave(data,pos,count) local n=count local bytes={string.byte(data,pos,pos+n*4-1)} local result={} for i=1,n do result[i]=bytes[i]*16777216+bytes[i+n]*65536+bytes[i+n*2]*256+bytes[i+n*3] end return result,pos+n*4 end function deinterleaveints(data,pos,count) local raw,p=deinterleave(data,pos,count) local result={} for _,v in ipairs(raw) do if v%2==0 then table.insert(result,v/2) else table.insert(result,-(v+1)/2) end end return result,p end function unrobloxfloat(bits) local rotated=math.floor(bits%4294967296) local unrotated=math.floor(rotated/2) if rotated%2==1 then unrotated=unrotated+2147483648 end unrotated=unrotated%4294967296 if unrotated==0 then return 0 end local sign=math.floor(unrotated/2^31) local exp=math.floor(unrotated/2^23)%256 local mantissa=unrotated%2^23 if exp==0 then return 0 end local v=(1+mantissa/2^23)*2^(exp-127) if sign==1 then v=-v end return v end function deinterleaverobfloats(data,pos,count) local raw,p=deinterleave(data,pos,count) local result={} for _,v in ipairs(raw) do table.insert(result,unrobloxfloat(v)) end return result,p end function decodereferents(data,pos,count) local deltas,p=deinterleaveints(data,pos,count) local result={} local acc=0 for _,d in ipairs(deltas) do acc=acc+d table.insert(result,acc) end return result,p end function xmlescape(s) s=tostring(s) s=s:gsub('&','&'):gsub('<','<'):gsub('>','>'):gsub('"','"') return s end function fmt(n) if n==math.huge then return 'INF' elseif n==-math.huge then return '-INF' elseif n~=n then return 'NAN' end return string.format('%.9g',n) end function b64encode(bytes) local chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' local out={} for i=1,#bytes,3 do local a,b,c=string.byte(bytes,i),string.byte(bytes,i+1) or 0,string.byte(bytes,i+2) or 0 local n=a*65536+b*256+c table.insert(out,chars:sub(math.floor(n/262144)%64+1,math.floor(n/262144)%64+1)) table.insert(out,chars:sub(math.floor(n/4096)%64+1,math.floor(n/4096)%64+1)) table.insert(out,i+1<=#bytes and chars:sub(math.floor(n/64)%64+1,math.floor(n/64)%64+1) or '=') table.insert(out,i+2<=#bytes and chars:sub(n%64+1,n%64+1) or '=') end return table.concat(out) end function decodecframerotations(data,pos,count) local rotations={} for i=1,count do local id,p2=readu8(data,pos) pos=p2 if id==0 then local r={} for j=1,9 do local v,p3=readf32le(data,pos) pos=p3 table.insert(r,v) end table.insert(rotations,r) else table.insert(rotations,CFRAME_ROTS[id] or {1,0,0,0,1,0,0,0,1}) end end return rotations,pos end function cframexml(name,x,y,z,rot) local xml=''..fmt(x)..''..fmt(y)..''..fmt(z)..'' if type(rot)=='table' then xml=xml..''..fmt(rot[1])..''..fmt(rot[2])..''..fmt(rot[3])..'' xml=xml..''..fmt(rot[4])..''..fmt(rot[5])..''..fmt(rot[6])..'' xml=xml..''..fmt(rot[7])..''..fmt(rot[8])..''..fmt(rot[9])..'' else xml=xml..'100010001' end return xml..'' end function decodepropvalues(typeid,data,pos,count,propname,sstr,classname) if typeid==0x01 then local pt=classname and getproptype(classname,propname) or nil local iscontent=pt=='Content' or hadtodothis[propname] local vals={} for i=1,count do local s,p=readlenstring(data,pos) pos=p if iscontent then if s=='' then table.insert(vals,'') else table.insert(vals,''..xmlescape(s)..'') end else table.insert(vals,''..xmlescape(s)..'') end end return vals,pos elseif typeid==0x02 then local vals={} for i=1,count do local b,p=readu8(data,pos) pos=p table.insert(vals,''.. (b~=0 and 'true' or 'false') ..'') end return vals,pos elseif typeid==0x03 then local ints,p=deinterleaveints(data,pos,count) pos=p local vals={} for _,v in ipairs(ints) do table.insert(vals,''..math.floor(v)..'') end return vals,pos elseif typeid==0x04 then local floats,p=deinterleaverobfloats(data,pos,count) pos=p local vals={} for _,v in ipairs(floats) do table.insert(vals,''..fmt(v)..'') end return vals,pos elseif typeid==0x05 then local vals={} for i=1,count do local a,b,c,d,e,f,g,h=string.byte(data,pos,pos+7) pos=pos+8 local lo=a+b*256+c*65536+d*16777216 local hi=e+f*256+g*65536+h*16777216 local v=hi*4294967296+lo table.insert(vals,''..string.format('%.17g',v)..'') end return vals,pos elseif typeid==0x06 then local scales,p=deinterleaverobfloats(data,pos,count) local offsets,p2=deinterleaveints(data,p,count) pos=p2 local vals={} for i=1,count do table.insert(vals,''..fmt(scales[i])..''..math.floor(offsets[i])..'') end return vals,pos elseif typeid==0x07 then local xs,p=deinterleaverobfloats(data,pos,count) local ys,p2=deinterleaverobfloats(data,p,count) local xo,p3=deinterleaveints(data,p2,count) local yo,p4=deinterleaveints(data,p3,count) pos=p4 local vals={} for i=1,count do table.insert(vals,''..fmt(xs[i])..''..math.floor(xo[i])..''..fmt(ys[i])..''..math.floor(yo[i])..'') end return vals,pos elseif typeid==0x08 then local vals={} for i=1,count do local ox,p1=readf32le(data,pos) local oy,p2=readf32le(data,p1) local oz,p3=readf32le(data,p2) local dx,p4=readf32le(data,p3) local dy,p5=readf32le(data,p4) local dz,p6=readf32le(data,p5) pos=p6 table.insert(vals,''..fmt(ox)..''..fmt(oy)..''..fmt(oz)..''..fmt(dx)..''..fmt(dy)..''..fmt(dz)..'') end return vals,pos elseif typeid==0x09 then local vals={} for i=1,count do local b,p=readu8(data,pos) pos=p local front=(math.floor(b/1)%2==1) and 'true' or 'false' local bottom=(math.floor(b/2)%2==1) and 'true' or 'false' local left=(math.floor(b/4)%2==1) and 'true' or 'false' local back=(math.floor(b/8)%2==1) and 'true' or 'false' local top=(math.floor(b/16)%2==1) and 'true' or 'false' local right=(math.floor(b/32)%2==1) and 'true' or 'false' table.insert(vals,''..front..''..bottom..''..left..''..back..''..top..''..right..'') end return vals,pos elseif typeid==0x0A then local vals={} for i=1,count do local b,p=readu8(data,pos) pos=p local x=(b%2==1) and 'true' or 'false' local y=(math.floor(b/2)%2==1) and 'true' or 'false' local z=(math.floor(b/4)%2==1) and 'true' or 'false' table.insert(vals,''..x..''..y..''..z..'') end return vals,pos elseif typeid==0x0B then local nums,p=deinterleave(data,pos,count) pos=p local vals={} for _,v in ipairs(nums) do table.insert(vals,''..v..'') end return vals,pos elseif typeid==0x0C then local rs,p=deinterleaverobfloats(data,pos,count) local gs,p2=deinterleaverobfloats(data,p,count) local bs,p3=deinterleaverobfloats(data,p2,count) pos=p3 local vals={} for i=1,count do table.insert(vals,''..fmt(rs[i])..''..fmt(gs[i])..''..fmt(bs[i])..'') end return vals,pos elseif typeid==0x0D then local xs,p=deinterleaverobfloats(data,pos,count) local ys,p2=deinterleaverobfloats(data,p,count) pos=p2 local vals={} for i=1,count do table.insert(vals,''..fmt(xs[i])..''..fmt(ys[i])..'') end return vals,pos elseif typeid==0x0E then local xs,p=deinterleaverobfloats(data,pos,count) local ys,p2=deinterleaverobfloats(data,p,count) local zs,p3=deinterleaverobfloats(data,p2,count) pos=p3 local vals={} for i=1,count do table.insert(vals,''..fmt(xs[i])..''..fmt(ys[i])..''..fmt(zs[i])..'') end return vals,pos elseif typeid==0x10 then local rotations,p=decodecframerotations(data,pos,count) local xs,p2=deinterleaverobfloats(data,p,count) local ys,p3=deinterleaverobfloats(data,p2,count) local zs,p4=deinterleaverobfloats(data,p3,count) pos=p4 local vals={} for i=1,count do table.insert(vals,cframexml(propname,xs[i],ys[i],zs[i],rotations[i])) end return vals,pos elseif typeid==0x12 then local nums,p=deinterleave(data,pos,count) pos=p local vals={} for _,v in ipairs(nums) do table.insert(vals,''..v..'') end return vals,pos elseif typeid==0x13 then local refs,p=decodereferents(data,pos,count) pos=p local vals={} for _,v in ipairs(refs) do table.insert(vals,''.. (v==-1 and 'null' or tostring(v)) ..'') end return vals,pos elseif typeid==0x14 then local vals={} for i=1,count do local x=string.byte(data,pos)+string.byte(data,pos+1)*256 local y=string.byte(data,pos+2)+string.byte(data,pos+3)*256 local z=string.byte(data,pos+4)+string.byte(data,pos+5)*256 pos=pos+6 if x>=32768 then x=x-65536 end if y>=32768 then y=y-65536 end if z>=32768 then z=z-65536 end table.insert(vals,''..x..''..y..''..z..'') end return vals,pos elseif typeid==0x15 then local vals={} for i=1,count do local kcount,p2=readu32le(data,pos) pos=p2 local kfs={} for k=1,kcount do local t,p3=readf32le(data,pos) local v,p4=readf32le(data,p3) local e,p5=readf32le(data,p4) pos=p5 table.insert(kfs,''..fmt(v)..''..fmt(e)..'') end table.insert(vals,''..table.concat(kfs)..'') end return vals,pos elseif typeid==0x16 then local vals={} for i=1,count do local kcount,p2=readu32le(data,pos) pos=p2 local kfs={} for k=1,kcount do local t,p3=readf32le(data,pos) local r,p4=readf32le(data,p3) local g,p5=readf32le(data,p4) local b,p6=readf32le(data,p5) local _,p7=readf32le(data,p6) pos=p7 table.insert(kfs,''..fmt(r)..''..fmt(g)..''..fmt(b)..'') end table.insert(vals,''..table.concat(kfs)..'') end return vals,pos elseif typeid==0x17 then local vals={} for i=1,count do local mn,p1=readf32le(data,pos) local mx,p2=readf32le(data,p1) pos=p2 table.insert(vals,''..fmt(mn)..' '..fmt(mx)..'') end return vals,pos elseif typeid==0x18 then local x0s,p=deinterleaverobfloats(data,pos,count) local y0s,p2=deinterleaverobfloats(data,p,count) local x1s,p3=deinterleaverobfloats(data,p2,count) local y1s,p4=deinterleaverobfloats(data,p3,count) pos=p4 local vals={} for i=1,count do table.insert(vals,''..fmt(x0s[i])..''..fmt(y0s[i])..''..fmt(x1s[i])..''..fmt(y1s[i])..'') end return vals,pos elseif typeid==0x19 then local vals={} for i=1,count do local custom,p1=readu8(data,pos) pos=p1 if custom==1 then local d,p2=readf32le(data,pos) local f,p3=readf32le(data,p2) local e,p4=readf32le(data,p3) local fw,p5=readf32le(data,p4) local ew,p6=readf32le(data,p5) pos=p6 table.insert(vals,'true'..fmt(d)..''..fmt(f)..''..fmt(e)..''..fmt(fw)..''..fmt(ew)..'') else table.insert(vals,'false') end end return vals,pos elseif typeid==0x1A then local rs={string.byte(data,pos,pos+count-1)} local gs={string.byte(data,pos+count,pos+count*2-1)} local bs={string.byte(data,pos+count*2,pos+count*3-1)} pos=pos+count*3 local vals={} for i=1,count do table.insert(vals,''..rs[i]..''..gs[i]..''..bs[i]..'') end return vals,pos elseif typeid==0x1B then local n=count local bs={string.byte(data,pos,pos+n*8-1)} local vals={} for i=1,n do local hi=bs[i]*16777216+bs[i+n]*65536+bs[i+n*2]*256+bs[i+n*3] local lo=bs[i+n*4]*16777216+bs[i+n*5]*65536+bs[i+n*6]*256+bs[i+n*7] local v=hi*4294967296+lo if v%2==0 then v=v/2 else v=-((v+1)/2) end table.insert(vals,''..string.format('%d',v)..'') end return vals,pos+n*8 elseif typeid==0x1C then local vals={} for i=1,count do local len,p=readu32le(data,pos) pos=p local bytes=data:sub(pos,pos+len-1) pos=pos+len table.insert(vals,''..b64encode(bytes)..'') end return vals,pos elseif typeid==0x1D then local vals={} for i=1,count do local s,p=readlenstring(data,pos) pos=p if s=='' then table.insert(vals,'') else table.insert(vals,''..xmlescape(s)..'') end end return vals,pos elseif typeid==0x1E then local rotations,p=decodecframerotations(data,pos,count) local xs,p2=deinterleaverobfloats(data,p,count) local ys,p3=deinterleaverobfloats(data,p2,count) local zs,p4=deinterleaverobfloats(data,p3,count) local presencestart=p4 local vals={} for i=1,count do local present=string.byte(data,presencestart+i-1) if present==0x00 then table.insert(vals,'') else local xml=''..fmt(xs[i])..''..fmt(ys[i])..''..fmt(zs[i])..'' local rot=rotations[i] if type(rot)=='table' then xml=xml..''..fmt(rot[1])..''..fmt(rot[2])..''..fmt(rot[3])..'' xml=xml..''..fmt(rot[4])..''..fmt(rot[5])..''..fmt(rot[6])..'' xml=xml..''..fmt(rot[7])..''..fmt(rot[8])..''..fmt(rot[9])..'' else xml=xml..'100010001' end table.insert(vals,xml..'') end end return vals,presencestart+count elseif typeid==0x1F then local vals={} for i=1,count do local idx,p=readu32le(data,pos) pos=p local s=sstr and sstr[idx] or '' if s=='' then table.insert(vals,'') else table.insert(vals,''..b64encode(s)..'') end end return vals,pos elseif typeid==0x20 then local vals={} for i=1,count do local flen,p=readu32le(data,pos) pos=p local family=data:sub(pos,pos+flen-1) pos=pos+flen local weight=string.byte(data,pos)+string.byte(data,pos+1)*256 pos=pos+2 local style=string.byte(data,pos) pos=pos+1 local clen,p2=readu32le(data,pos) pos=p2 local cacheid=data:sub(pos,pos+clen-1) pos=pos+clen table.insert(vals,''..xmlescape(family)..''..weight..''..xmlescape(cacheid)..'') end return vals,pos elseif typeid==0x21 then local n=count local bs={string.byte(data,pos,pos+n*8-1)} local vals={} for i=1,n do local hi=bs[i]*16777216+bs[i+n]*65536+bs[i+n*2]*256+bs[i+n*3] local lo=bs[i+n*4]*16777216+bs[i+n*5]*65536+bs[i+n*6]*256+bs[i+n*7] local v=hi*4294967296+lo table.insert(vals,''..string.format('%d',v)..'') end return vals,pos+n*8 else return nil,pos end end function binarytorbxmx(data) local pos=1 assert(data:sub(pos,pos+7)=='') table.insert(lines,indent2..'') local sortedprops={} for k in pairs(inst.props) do table.insert(sortedprops,k) end table.sort(sortedprops) for _,k in ipairs(sortedprops) do table.insert(lines,indent2..'\t'..inst.props[k]) end table.insert(lines,indent2..'') if children[ref] then table.sort(children[ref]) for _,child in ipairs(children[ref]) do table.insert(lines,buildxml(child,depth+1)) end end table.insert(lines,indent..'') return table.concat(lines,'\n') end local roots={} for _,ref in ipairs(instorder) do local par=parents[ref] if not par or par==-1 or not instprops[par] then table.insert(roots,ref) end end local xmllines={''} for _,ref in ipairs(roots) do table.insert(xmllines,buildxml(ref,1)) end table.insert(xmllines,'') return table.concat(xmllines,'\n') end function okbro(x,y) writefile(x..'.rbxmx',binarytorbxmx(readfile(y..'.rbxm'))) end