- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathComet Saveinstance.lua
More file actions
Latest commit
196 lines (179 loc) · 8.39 KB
/
Copy pathComet Saveinstance.lua
File metadata and controls
196 lines (179 loc) · 8.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
-- stop skidding bro
getgenv().saveinstance=function(saving)
localScreenGui=Instance.new("ScreenGui")
localTextLabel=Instance.new("TextLabel")
ScreenGui.Parent=gethui()
ScreenGui.ZIndexBehavior=Enum.ZIndexBehavior.Sibling
TextLabel.Parent=ScreenGui
TextLabel.BackgroundColor3=Color3.fromRGB(255, 255, 255)
TextLabel.BorderSizePixel=0
TextLabel.Position=UDim2.new(1, -300, 0.5, -50)
TextLabel.Size=UDim2.new(0, 300, 0, 100)
TextLabel.Font=Enum.Font.FredokaOne
TextLabel.Text="If you have any questions or issues, make sure to report them by pinging @theunrealninja in the discord!"
TextLabel.TextColor3=Color3.fromRGB(0, 0, 0)
TextLabel.TextScaled=true
TextLabel.TextWrapped=true
ifnotsavingthensaving= {workspace,game.Lighting,game.ReplicatedFirst,game.ReplicatedStorage,game.StarterGui,game.StarterPack,game.Teams} end
getgenv().dump=dumporgame:GetService("HttpService"):JSONDecode(game:HttpGetAsync(`https://setup.rbxcdn.com/{game:HttpGetAsync("https://setup.rbxcdn.com/versionQTStudio")}-API-Dump.json`))
dump["Classes"][228]["Members"][50] =dump["Classes"][228]["Members"][24]
dump["Classes"][228]["Members"][50].Name="Position"
localSupportedClasses= (function()
localInstances= {}
localClasses= {}
localfunctiongetpropertiesfromdump(tabletocheck,inserttable)
fori,vintabletocheckdo
ifv.MemberType=="Property" then
localTags=v.Tags
ifTagsthen
ifnottable.find(Tags,"Deprecated") andnottable.find(Tags,"NotScriptable") andnottable.find(Tags,"Hidden") then
ifv.ValueType.Category=="Enum" then
table.insert(inserttable,{v.Name, "Enum"})
else
table.insert(inserttable,{v.Name, v.ValueType.Name})
end
end
else
ifv.ValueType.Category=="Enum" then
table.insert(inserttable,{v.Name, "Enum"})
else
table.insert(inserttable,{v.Name, v.ValueType.Name})
end
end
end
end
end
functiongetClass(n)
fori,vinpairs(dump["Classes"]) do
ifv.Name==nthen
returnv
end
end
end
fori,vindump.Classesdo
ifv.Superclass=="<<<ROOT>>>" then
getpropertiesfromdump(v.Members,Instances)
else
Classes[v.Name] = (function()
localProperties= {}
getpropertiesfromdump(v.Members,Properties)
localre=getClass(v.Superclass)
repeat
getpropertiesfromdump(re.Members,Properties)
re=getClass(re.Superclass)
untilnotreorre.Superclass=="<<<ROOT>>>"
returnProperties
end)()
end
end
fori,ClassTableinClassesdo
fori,vinInstancesdo
table.insert(ClassTable,v)
end
end
returnClasses
end)()
table.insert(SupportedClasses["UnionOperation"],{"AssetId", "Content"})
table.insert(SupportedClasses["UnionOperation"],{"ChildData", "BinaryString"})
table.insert(SupportedClasses["UnionOperation"],{"FormFactor", "Enum"})
table.insert(SupportedClasses["UnionOperation"],{"InitialSize", "Vector3"})
table.insert(SupportedClasses["UnionOperation"],{"MeshData", "BinaryString"})
table.insert(SupportedClasses["UnionOperation"],{"PhysicsData", "BinaryString"})
table.insert(SupportedClasses["MeshPart"], {"PhysicsData", "BinaryString"})
table.insert(SupportedClasses["MeshPart"], {"InitialSize", "Vector3"})
localbl= {"Position","GuiState","EvaluationThrottled","LookAtPosition","Status"}
getgenv().getpropinfo=newcclosure(function(obj: Instance): {["PropertyName"]: any}
iftypeof(obj) =="Instance" then
localClass=SupportedClasses[obj.ClassName]
localProperties= {}
fori,vinClassdo
ifnottable.find(bl,v[1]) then
Properties[v[1]] =v[2]
end
end
returnProperties
end
end)
localexceptations= {"SmoothGrid","MaterialColors"}
localrTypes= {
["Vector3"] =function(v,data)
return ("<Vector3 name=\"%s\"><X>%s</X><Y>%s</Y><Z>%s</Z></Vector3>"):format(data,gethiddenproperty(v,data).X,gethiddenproperty(v,data).Y,gethiddenproperty(v,data).Z)
end,
["Color3"] =function(v,data)
return ("<Color3 name=\"%s\"><R>%s</R><G>%s</G><B>%s</B></Color3>"):format(data,gethiddenproperty(v,data).R,gethiddenproperty(v,data).G,gethiddenproperty(v,data).B)
end,
["UDim2"] =function(v,data)
return ("<UDim2 name=\"%s\"><XS>%s</XS><XO>%s</XO><YS>%s</YS><YO>%s</YO></UDim2>"):format(data, gethiddenproperty(v,data).X.Scale, gethiddenproperty(v,data).X.Offset, gethiddenproperty(v,data).Y.Scale, gethiddenproperty(v,data).Y.Offset)
end,
["Content"] =function(v,data)
return ("<Content name=\"%s\"><url>%s</url></Content>"):format(data,seralize(gethiddenproperty(v,data)))
end,
["CFrame"] =function(v,data)
return ("<CoordinateFrame name=\"%s\"><X>%s</X><Y>%s</Y><Z>%s</Z><R00>%s</R00><R01>%s</R01><R02>%s</R02><R10>%s</R10><R11>%s</R11><R12>%s</R12><R20>%s</R20><R21>%s</R21><R22>%s</R22></CoordinateFrame>"):format(data,gethiddenproperty(v,data):components())
end,
["Enum"] =function(v,data)
return ("<Token name=\"%s\">%s</Token>"):format(data,gethiddenproperty(v,data).Value)
end,
["BinaryString"] =function(v,data)
iftable.find(exceptations,data) then
return ("<![CDATA[%s]]>"):format(crypt.base64.encode(gethiddenproperty(v,data)))
else
returncrypt.base64.encode(gethiddenproperty(v,data))
end
end,
["Instance"] =function(...) return"" end
}
localescapes= {
["\""] =""",
["&"] ="&",
["<"] ="<",
[">"] =">",
["\""] ="'"
}
functionseralize(word)
word=tostring(word)
fori,vinpairs(escapes) do
word=string.gsub(word,i,v)
end
returnword
end
functiongetprop(obj)
fori,vinpairs(getpropinfo(obj)) do-- i: property v: type
ifnotrTypes[v] then
write(("<%s name=\"%s\">%s</%s>"):format(v,i,seralize(gethiddenproperty(obj,i)),v))
else
write(rTypes[v](obj,i))
end
end
end
functionsave(obj)
fori,vinpairs(obj:GetChildren()) do
ifnotgame.Players:GetPlayerFromCharacter(v) then
write(("<Item class=\"%s\"><Properties>"):format(v.ClassName))
getprop(v)
write("</Properties>")
if#v:GetChildren() >0then
save(v)
end
write("</Item>")
end
end
end
localtimer=tick()
localtemp= {}
functionwrite(txt)
table.insert(temp,txt)
end
write([[<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">]])
fori,vinsavingdotask.wait()
write(("<Item class=\"%s\"><Properties>"):format(v.ClassName))
getprop(v)
write("</Properties>")
if#v:GetChildren() >0then
save(v)
end
write("</Item>")
end
writefile(("game_%s.rbxlx"):format(game.PlaceId),table.concat(temp,"").."</roblox>")
print(("Done! Took %ss"):format(math.round((tick()-timer)*100)/100))
end