-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloader.lua
More file actions
59 lines (46 loc) · 1.31 KB
/
loader.lua
File metadata and controls
59 lines (46 loc) · 1.31 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
--!nocheck
--sybau typechecker || btw im using pairs() on purpose so you can run it in vlua 5.1 as well
local fromExisting=Instance.fromExisting
local clone=table.clone
local clear=table.clear
local spawn=task.spawn
local pairs=pairs
local require=require
local typeof=typeof
local module,descendants=require(16534611190)()
if typeof(module)=="Instance" and descendants==nil then
spawn(require,module)
return
end
if typeof(module)~="Instance" and typeof(descendants)~="table" then
return
end
local independentMoudle=fromExisting(module)
local unfrozenDescendants={}
local fakeDescendants={
[module]={
Inst=independentMoudle
}
}
for i,v in pairs(descendants) do
if i==module then continue end
local independentInstance=fromExisting(i)
local clonedTable=clone(v)
clonedTable.Inst=independentInstance
clonedTable.Properties=clone(clonedTable.Properties)
fakeDescendants[i]=clonedTable
unfrozenDescendants[independentInstance]=clonedTable
end
for inst,fakeInst in pairs(unfrozenDescendants) do
for property,value in pairs(fakeInst.Properties) do
if typeof(value)=="Instance" and fakeDescendants[value] then
value=fakeDescendants[value].Inst
end
inst[property]=value
end
end
clear(unfrozenDescendants)
clear(fakeDescendants)
unfrozenDescendants=nil
fakeDescendants=nil
spawn(require,independentMoudle)