Run it
Copy the script and paste it into your executor.
Players = :()
UIS = :()
TweenService = :()
LogService = :()
CoreGui = :()
HttpService = :()
lp = Players.LocalPlayer
NAME =
VERSION =
LOGO_URL =
LOGO_FILE =
FOLDER =
DB_FOLDER =
FONT_FAMILY =
PATH = {
auto = FOLDER .. ,
img = FOLDER .. ,
ui = FOLDER .. .. VERSION .. ,
cloud = FOLDER .. ,
autoIdx = FOLDER .. ,
saved = FOLDER .. ,
likes = FOLDER .. ,
stats = FOLDER .. ,
flag = FOLDER .. .. VERSION .. ,
}
PATH.fast =
PATH.folderMissing =
(()
(isfile isfolder)
PATH.folderMissing = (FOLDER)
PATH.fast = ( PATH.folderMissing) (PATH.flag) (LOGO_FILE) (PATH.ui)
)
PATH.fast
(() isfile delfile (PATH.flag) (PATH.flag) )
(()
makefolder isfolder
_, d ({FOLDER, PATH.auto, PATH.img, DB_FOLDER})
(d) (d)
writefile isfile
_, d ({FOLDER, PATH.img})
(d .. ) (d .. , )
listfiles delfile
fl = (PATH.img)
#fl >
_, f (fl)
f:() (delfile, f)
isfile delfile () (delfile, )
)
(path, getData)
ok, res = (()
(isfile (path)) (path, ())
(getcustomasset getsynasset)(path)
)
ok res res
Compat
BRAND = {name = NAME, ver = VERSION}
CONFIG = {compat = {polyfill = , semantics = , sharedGlobals = , globalize = , autotest = , intrusive = }}
UserInputSvc = :()
round = (x) .(x + )
ENV =
() ==
ok, e = ()
ok (e) == ENV = e
(n)
v = (ENV, n)
v == v = (, n)
v == (getfenv) ==
ok, r = (() ()[n] )
ok v = r
v
RAW_PRINT = ENV.print
LOADSTRING = (() == ) ()
(LOADSTRING) ~= LOADSTRING =
EXECUTOR_NAME =
idFn = ()
(idFn) ==
ok, n = (idFn)
ok (n) == EXECUTOR_NAME = n
Bus = {h = {}}
Bus.(evt, fn)
Bus.h[evt] = Bus.h[evt] {}
.(Bus.h[evt], fn)
Bus.(evt, ...)
_, f (Bus.h[evt] {}) (f, ...)
Bus.(, () Compat Compat.onState Compat.() )
Log = {}
_, lvl ({, , , })
Log[lvl] = (msg)
m = (msg)
#m > m = m:(, ) ..
Compat Compat.sink (Compat.sink, lvl, m)
Compat =
Compat = { specs = {}, byName = {}, stats = , running = , conns = {} }
ROOT_G =
specs, byName = Compat.specs, Compat.byName
resolved = {}
wrapped = ({}, { __mode = })
identity =
appActive =
rng = Random.()
(()
Compat.conns[#Compat.conns + ] = UserInputSvc.WindowFocused:(() appActive = )
Compat.conns[#Compat.conns + ] = UserInputSvc.WindowFocusReleased:(() appActive = )
)
(name) resolved[name]
(c, m) c (m , )
(...)
_, n ({ ... })
(resolved[n]) ~= ( .. n, )
(name, cat, poly, test, approx)
s = { name = name, cat = cat, poly = poly, test = test, approx = approx }
specs[#specs + ] = s
byName[name] = s
s
(name, target, cat)
(name, cat, (r) (target) ,
(f) ((f) == , ) , .. target)
(cat, list)
_, n (list) (n, cat)
(p)
t = {}
part p:() t[#t + ] = part
t
(name)
parts = (name)
cur = (parts[])
i = , #parts
(cur) ~=
cur = cur[parts[i]]
cur
(name)
s = byName[name]
s ~= s.native ~=
B64 =
B64REV = {}
i = , B64REV[B64:(i)] = i -
(data)
data = (data)
out = {}
i = , #data,
a, b, c = data:(i, i + )
n = a * + (b ) * + (c )
c1 = .(n / ) %
c2 = .(n / ) %
c3 = .(n / ) %
c4 = n %
out[#out + ] = B64:(c1 + , c1 + ) .. B64:(c2 + , c2 + )
.. (b B64:(c3 + , c3 + ) ) .. (c B64:(c4 + , c4 + ) )
.(out)
(s)
s = (s):(, )
out = {}
i = , #s,
a, b, c, d = s:(i, i + )
n1, n2 = B64REV[a], B64REV[b]
n1 n2
n3 = c B64REV[c]
n4 = d B64REV[d]
n = n1 * + n2 * + (n3 ) * + (n4 )
out[#out + ] = .(.(n / ) % )
n3 out[#out + ] = .(.(n / ) % )
n4 out[#out + ] = .(n % )
.(out)
(n)
t = {}
i = , n t[i] = .(rng:(, ))
.(t)
(x)
x = x %
x >= x = x -
x
(buf, n)
parts = {}
i =
i <= n
j = .(i + , n)
parts[#parts + ] = .(.(buf, i, j))
i = j +
.(parts)
(h)
(h:(, (x) .((x, )) ))
(n)
.(bit32.(n, ) % , bit32.(n, ) % , bit32.(n, ) % , n % )
(msg)
len = #msg
bits = len *
msg .. .. .(, ( - len) % )
.. (.(bits / )) .. (bits % )
K256, H256 = {}, {}
primes, n = {},
#primes <
isP =
_, p (primes)
p * p > n
n % p == isP = ;
isP primes[#primes + ] = n
n = n +
i = , K256[i] = .((primes[i] ^ ( / )) % * )
i = , H256[i] = .((primes[i] ^ ) % * )
(msg, iv)
msg = ((msg))
h = .(iv H256)
w = {}
pos = , #msg,
i = ,
a, b, c, d = msg:(pos + i * , pos + i * + )
w[i] = a * + b * + c * + d
i = ,
x, y = w[i - ], w[i - ]
s0 = bit32.(bit32.(x, ), bit32.(x, ), bit32.(x, ))
s1 = bit32.(bit32.(y, ), bit32.(y, ), bit32.(y, ))
w[i] = (w[i - ] + s0 + w[i - ] + s1) %
a, b, c, d, e, f, g, hh = h[], h[], h[], h[], h[], h[], h[], h[]
i = ,
S1 = bit32.(bit32.(e, ), bit32.(e, ), bit32.(e, ))
ch = bit32.(bit32.(e, f), bit32.(bit32.(e), g))
t1 = (hh + S1 + ch + K256[i + ] + w[i]) %
S0 = bit32.(bit32.(a, ), bit32.(a, ), bit32.(a, ))
maj = bit32.(bit32.(a, b), bit32.(a, c), bit32.(b, c))
t2 = (S0 + maj) %
hh, g, f, e, d, c, b, a = g, f, e, (d + t1) % , c, b, a, (t1 + t2) %
h[] = (h[] + a) % ; h[] = (h[] + b) %
h[] = (h[] + c) % ; h[] = (h[] + d) %
h[] = (h[] + e) % ; h[] = (h[] + f) %
h[] = (h[] + g) % ; h[] = (h[] + hh) %
out = {}
i = , out[i] = .(, h[i])
.(out)
(msg)
msg = ((msg))
h0, h1, h2, h3, h4 = , , , ,
w = {}
pos = , #msg,
i = ,
a, b, c, d = msg:(pos + i * , pos + i * + )
w[i] = a * + b * + c * + d
i = ,
w[i] = bit32.(bit32.(w[i - ], w[i - ], w[i - ], w[i - ]), )
a, b, c, d, e = h0, h1, h2, h3, h4
i = ,
f, k
i < f = bit32.(bit32.(b, c), bit32.(bit32.(b), d)); k =
i < f = bit32.(b, c, d); k =
i < f = bit32.(bit32.(b, c), bit32.(b, d), bit32.(c, d)); k =
f = bit32.(b, c, d); k =
temp = (bit32.(a, ) + f + e + k + w[i]) %
e, d, c, b, a = d, c, bit32.(b, ), a, temp
h0 = (h0 + a) % ; h1 = (h1 + b) % ; h2 = (h2 + c) %
h3 = (h3 + d) % ; h4 = (h4 + e) %
.(, h0, h1, h2, h3, h4)
MD5K, MD5S = {}, {
, , , , , , , , , , , , , , , ,
, , , , , , , , , , , , , , , ,
, , , , , , , , , , , , , , , ,
, , , , , , , , , , , , , , , ,
}
i = , MD5K[i] = .(.(.(i + )) * )
(n)
.(n % , bit32.(n, ) % , bit32.(n, ) % , bit32.(n, ) % )
(msg)
msg = (msg)
len = #msg
bits = len *
msg = msg .. .. .(, ( - len) % ) .. (bits % ) .. (.(bits / ))
a0, b0, c0, d0 = , , ,
M = {}
pos = , #msg,
i = ,
a, b, c, d = msg:(pos + i * , pos + i * + )
M[i] = a + b * + c * + d *
A, B, C, D = a0, b0, c0, d0
i = ,
F, g
i < F = bit32.(bit32.(B, C), bit32.(bit32.(B), D)); g = i
i < F = bit32.(bit32.(D, B), bit32.(bit32.(D), C)); g = ( * i + ) %
i < F = bit32.(B, C, D); g = ( * i + ) %
F = bit32.(C, bit32.(B, bit32.(D))); g = ( * i) %
F = (F + A + MD5K[i] + M[g]) %
A, D, C = D, C, B
B = (B + bit32.(F, MD5S[i + ])) %
a0 = (a0 + A) % ; b0 = (b0 + B) %
c0 = (c0 + C) % ; d0 = (d0 + D) %
(n) ((n):(, (ch) .(, ch:()) ))
(a0) .. (b0) .. (c0) .. (d0)
IV224 = { , , , , , , , }
(msg) (msg, IV224):(, )
CRCT = {}
i = ,
c = i
_ = ,
bit32.(c, ) == c = bit32.(bit32.(c, ), ) c = bit32.(c, )
CRCT[i] = c
(msg)
msg = (msg)
c =
i = , #msg
c = bit32.(bit32.(c, ), CRCT[bit32.(bit32.(c, msg:(i)), )])
.(, bit32.(c, ))
HASHES = { sha1 = sha1, sha224 = sha224, sha256 = sha256, md5 = md5, crc32 = crc32 }
(data, alg)
alg = (alg ):():(, )
h = HASHES[alg]
h ( .. (alg) .. , )
(data)
(key, iv, n)
out = {}
i = , .(n / ) - out[#out + ] = ((key .. iv .. (i)))
.(out):(, n)
(a, b)
out = {}
i = , #a out[i] = .(bit32.(a:(i), b:(i)))
.(out)
(iv)
iv == iv == ()
iv = (iv)
d = (iv)
#d == d
iv
(data, key, iv)
(data) ~= key == (, )
ivRaw = (iv)
ks = ((key), ivRaw, #data)
((data, ks)), (ivRaw)
(data, key, iv)
(data) ~= key == (, )
raw = (data)
ivRaw = (iv)
(raw, ((key), ivRaw, #raw))
(src, outSize)
src = (src)
out, o, i, n = {}, , , #src
i <= n
token = src:(i); i = i +
lit = bit32.(token, )
lit ==
b = src:(i); i = i + ; lit = lit + b b ~= i > n
_ = , lit o = o + ; out[o] = src:(i); i = i +
i > n
off = src:(i) + src:(i + ) * ; i = i +
off == off > o (, )
ml = bit32.(token, )
ml ==
b = src:(i); i = i + ; ml = ml + b b ~= i > n
ml = ml +
_ = , ml o = o + ; out[o] = out[o - off]
s = (out, o)
outSize #s ~= outSize s = s:(, outSize)
s
(src)
src = (src)
n = #src
out, o = {},
(b) o = o + ; out[o] = b
(v) v >= (); v = v - (v)
(litStart, litEnd, off, mlen)
lit = litEnd - litStart +
tok = .(lit, ) *
mlen tok = tok + .(mlen - , )
(tok)
lit >= (lit - )
j = litStart, litEnd (src:(j))
mlen
(off % ); (.(off / ))
mlen - >= (mlen - - )
ht, anchor, i = {}, ,
limit = n -
i <= limit
key = src:(i, i + )
cand = ht[key]
ht[key] = i
cand i - cand <=
mlen =
i + mlen <= n - src:(cand + mlen) == src:(i + mlen) mlen = mlen +
(anchor, i - , i - cand, mlen)
i = i + mlen
anchor = i
i = i +
(anchor, n, , )
(out, o)
VFS = { files = {}, folders = {} }
(p)
p = (p):(, )
p = p:(, )
p = p:(, )
p == p =
p
(p) p:()
(p)
par = (p)
par par ~=
VFS.folders[par] =
par = (par)
vfs = {}
vfs.(path, data) path = (path); (path); VFS.files[path] = (data)
vfs.(path)
path = (path)
d = VFS.files[path]
d == ( .. path, )
d
vfs.(path) VFS.files[(path)] ~=
vfs.(path) path = (path); path == VFS.folders[path] ==
vfs.(path) path = (path); (path); VFS.folders[path] =
vfs.(path)
path = (path)
VFS.files[path] == ( .. path, )
VFS.files[path] =
vfs.(path)
path = (path)
VFS.folders[path] =
pre = path ..
k (VFS.files) k:(, #pre) == pre VFS.files[k] =
k (VFS.folders) k:(, #pre) == pre VFS.folders[k] =
vfs.(path)
path = (path)
path ~= VFS.folders[path] ( .. path, )
out = {}
(k)
par = (k)
(par == path) (path == par == ) out[#out + ] = k
k (VFS.files) (k)
k (VFS.folders) (k)
.(out)
out
(, , , (f)
fn = ()
((fn) == , )
(() == , )
bad, err = ()
(bad == (err) == , )
)
(, , () () ENV , (f)
g = ()
((g) == , )
g.__hxProbe =
(().__hxProbe == , )
g.__hxProbe =
)
RENV_NAMES = { , , , , , , , , , ,
, , , , , , , , , ,
, , , , , , , , , , ,
, , , , , , , , , , ,
, , , , , }
(, , ()
()
t = {}
_, n (RENV_NAMES) t[n] = (n)
t._G = ROOT_G
t
, (f)
r = ()
((r) == , )
((r.print) == , )
(r.game ~= , )
, )
(, , ()
() (EXECUTOR_NAME ~= ) EXECUTOR_NAME BRAND.name, BRAND.ver
, (f)
n = ()
((n) == n ~= , )
, )
(, , )
(, , ()
()
ok, ui = (() CoreGui )
ok ui :()
, (f) ((()) == , ) , )
(, , () () ,
(f) (() == , ) )
(, , () () appActive ,
(f) ((()) == , ) , )
(, , )
(, , () () identity ,
(f) ((()) == , ) ,
)
(, , ()
(n)
n = (n)
n n < n > (, )
identity = .(n)
, (f)
()
old = resolved.()
()
ok = resolved.() ==
(old)
(ok, )
, )
(, , )
(, , )
(, { , , , , ,
, , , , , })
(, , )
(, , ()
() :()
, (f)
t = ()
((t) == #t > , )
((t[]) == , )
, )
(pred)
()
out = {}
_, i (:()) (i) out[#out + ] = i
out
(, , ()
((i) i:() i:() )
, (f)
t = ()
((t) == , )
t[] (t[]:(), )
, )
(, , ()
((i) i:() )
, (f)
t = ()
((t) == , )
t[] (t[]:(), )
, )
(, , ()
((i) i:() i.Disabled )
, (f)
t = ()
((t) == , )
i = , .(#t, )
v = t[i]
((v) == (v:() v:() v:()),
)
, )
(, , ()
()
lvl = ,
ok, env = (getfenv, lvl)
ok (env) ==
s = (env, )
(s) == s
, (f)
s = ()
(s == (s) == , )
, )
(, { , , , , })
(, { , , , , ,
, , , })
(, { })
Compat.cacheGone = ({}, { __mode = })
(, , ()
(inst)
(inst) ~= (, )
Compat.cacheGone[inst] ~=
, (f)
p = .()
p.Parent =
v = (p)
p:()
(v == , )
, )
(, , ()
(inst)
(inst) ~= (, )
Compat.cacheGone[inst] =
, (f)
()
p = .()
p.Parent =
(p)
v = resolved[](p)
p:()
(v == , )
, )
Compat.mb = { active = }
(, , ()
(text, caption, flags)
flags = (flags)
kind = flags %
btns
kind == btns = { { , }, { , } }
kind == btns = { { , }, { , }, { , } }
kind == btns = { { , }, { , }, { , } }
kind == btns = { { , }, { , } }
kind == btns = { { , }, { , } }
btns = { { , } }
gui = .()
gui.Name =
gui.IgnoreGuiInset =
gui.ResetOnSpawn =
gui.DisplayOrder =
okp = (() gui.Parent = CoreGui )
okp gui.Parent
gh = ()
okh = (() gui.Parent = ((gh) == ) () CoreGui )
okh gui.Parent
(() gui.Parent = :().LocalPlayer:(, ) )
shade = .()
shade.Size = .(, , , )
shade.BackgroundColor3 = .(, , )
shade.BackgroundTransparency =
shade.BorderSizePixel =
shade.Active =
shade.Parent = gui
box = .()
box.AnchorPoint = .(, )
box.Position = .(, , , )
box.Size = .(, , , )
box.BackgroundColor3 = .(, , )
box.BorderSizePixel =
box.Parent = shade
cap = .()
cap.BackgroundColor3 = .(, , )
cap.BorderSizePixel =
cap.Size = .(, , , )
cap.Font = .Font.SourceSansBold
cap.TextSize =
cap.TextColor3 = .(, , )
cap.Text = .. (caption BRAND.name)
cap.TextXAlignment = .TextXAlignment.Left
cap.Parent = box
msg = .()
msg.BackgroundTransparency =
msg.Position = .(, , , )
msg.Size = .(, -, , -)
msg.Font = .Font.SourceSans
msg.TextSize =
msg.TextWrapped =
msg.TextXAlignment = .TextXAlignment.Left
msg.TextYAlignment = .TextYAlignment.Top
msg.TextColor3 = .(, , )
msg.Text = (text)
msg.Parent = box
result
(n)
result ~=
result = n
(() gui:() )
bw =
total = #btns * bw + (#btns - ) *
i, b (btns)
btn = .()
btn.AnchorPoint = .(, )
btn.Position = .(, -total / + (i - ) * (bw + ), , -)
btn.Size = .(, bw, , )
btn.BackgroundColor3 = .(, , )
btn.BorderSizePixel =
btn.Font = .Font.SourceSansBold
btn.TextSize =
btn.TextColor3 = .(, , )
btn.Text = b[]
btn.Parent = box
btn.Activated:(() (b[]) )
Compat.mb.active = { close = close }
result ==
gui.Parent result = ;
.()
Compat.mb.active =
result
, , )
(, , ()
(inst)
(inst) ~= (, )
inst
, (f)
c = ()
((c) == c.Name == .Name, )
(c ~= , )
, )
(, , ()
(a, b)
(a) ~= (b) ~= (, )
a == b
, (f)
((, ) == , )
((, ) == , )
)
(inst, prop)
ok, v = (() inst[prop] )
ok, v
(, , ()
(inst, prop)
(inst) ~= (, )
ok, v = (inst, (prop))
ok ( .. (prop) .. , )
v,
, (f)
p = .()
v, hidden = (p, )
p:()
((v) == , )
(hidden == , )
, )
(, , ()
(inst, prop, value)
(inst) ~= (, )
ok, err = (() inst[prop] = value )
ok ((err), )
, (f)
p = .()
(p, , .(, , ))
ok = p.Size == .(, , )
p:()
(ok, )
, )
(, , ()
(inst, prop)
(inst) ~= (, )
ok = (inst, (prop))
ok
, (f)
p = .()
a = (p, )
p:()
(a == , )
, )
SERVICE_PREFIX = { , , , , ,
, , , , , , }
(, , () () ,
(f) (() == , ) ,
)
(, , ()
(fn)
(fn) ~= (, )
c = (...) (...)
wrapped[c] =
c
, (f)
fn = (a) a *
c = (fn)
((c) == , )
(() == , )
(c ~= fn, )
, )
(, , ()
(fn)
(fn) ~= (, )
wrapped[fn]
ok, s = (debug.info, fn, )
ok s ==
, (f)
(() == , )
((() ) == , )
()
((resolved.(() )) == , )
, )
(, , (r)
(fn)
(fn) ~= (, )
()(fn)
, (f)
((() ) == , )
(() == , )
)
(, , (r)
(fn)
(fn) ~= (, )
c = (...) (...)
isc = ()
isc (fn) wrapped[c] =
c
, (f)
fn = ()
c = (fn)
(c ~= fn, )
(() == , )
, )
(, , (r)
(fn)
(fn) ~= (, )
wrapped[fn]
ok, src = (debug.info, fn, )
ok src == src ==
_, p (SERVICE_PREFIX)
src:(, #p) == p
, (f)
((() ) == , )
(() == , )
, )
(, , )
(, , )
(, , ()
(obj, method, hook)
(method) ~= (hook) ~= (, )
mt = (obj)
(mt) ~= (, )
old = (mt, method)
ok, err = (() mt[method] = hook )
ok ( .. (err), )
old
, (f)
obj = ({}, { __index = () })
old = (obj, , () )
hooked = obj.x ==
(obj, , old)
(hooked, )
, )
(, { , , , })
(, , ()
(t)
mt = (t)
(mt) == mt
, (f)
mt = { __index = () }
((({}, mt)) == mt, )
, )
(, , ()
(t, mt) (t, mt); t
, (f)
t, mt = {}, {}
(t, mt)
((t) == mt, )
, )
(, , ()
(t)
(t) ~= (, )
.(t)
, (f)
t = {}
((t) == , )
.(t)
((t) == , )
, )
(, { })
(, , ()
(target, what)
src, line, name, np, va
(target) ==
src, line, name, np, va = debug.(target + , )
ok
ok, src, line, name, np, va = (debug.info, target, )
ok
src ==
isC = (src == )
{
source = isC ( .. (src)), short_src = src,
currentline = line -, linedefined = line -, lastlinedefined = -,
name = name, what = isC , numparams = np ,
is_vararg = va , nups = , func = ((target) == ) target ,
}
, (f)
i = ()
((i) == , )
(i.what == , )
l = (() )
((l) == l.what == , )
lv = ()
((lv) == (lv.currentline) == , )
, )
(, { , , , ,
, , , , ,
, , , })
() .. (rng:(, ))
(cond, secs)
t0 = .()
ok, v = (cond)
ok v
.()
.() - t0 > (secs )
(n) d = resolved.delfile; d (d, n)
(n)
()
() ()
vfs[n]
fsTests = {
writefile = (f)
()
n = () ..
okW, errW = (f, n, )
ok = (() resolved.(n) == )
ok
isf = resolved.isfile (, (resolved.isfile, n))
okR, rv = (resolved.readfile, n)
j = () ..
(f, j, )
jok = (() resolved.(j) == , )
(j)
(n)
(.(,
okW , okW ( .. (errW) .. ), (isf),
okR (rv), (jok)), )
(n)
,
readfile = (f)
()
n = () ..
resolved.(n, )
ok = (() (n) == )
(n)
(ok, )
( (f, n .. ), )
,
isfile = (f)
()
n = () ..
((n) == , )
resolved.(n, )
ok = (() (n) == )
(n)
(ok, )
,
delfile = (f)
(, )
n = () ..
resolved.(n, )
((() resolved.(n) ), )
(n)
((() resolved.(n) == ), )
,
makefolder = (f)
(, )
d = ()
(d)
ok = (() resolved.(d) == )
(resolved.delfolder, d)
(ok, )
,
isfolder = (f)
(, )
d = ()
((d) == , )
resolved.(d)
ok = (() (d) == )
(resolved.delfolder, d)
(ok, )
,
delfolder = (f)
(, )
d = ()
resolved.(d)
((() resolved.(d) == ), )
(d)
((() resolved.(d) == ), )
,
listfiles = (f)
(, , )
d = ()
resolved.(d)
(() resolved.(d) == )
resolved.(d .. , )
l
ok = (()
l = (d)
(l) == #l == (l[]):(, , ) ~=
)
(resolved.delfolder, d)
(ok, )
,
}
_, n ({ , , , , , , , })
(n, , (n), fsTests[n], )
(, , (r)
rf, wf, isf = (), (), ()
(rf wf isf)
(path, data)
(path) (path, (path) .. (data)) (path, (data))
, (f)
(, )
n = () ..
resolved.(n, )
(() resolved.(n) == )
(n, )
ok = (() resolved.(n) == )
(n)
(ok, )
, )
(, , (r)
rf = ()
(rf LOADSTRING)
(path)
ok, src = (rf, path)
ok , (src)
(src, .. (path))
, (f)
()
n = () ..
resolved.(n, )
(() resolved.(n) == )
fn = (n)
(n)
((fn) == () == , )
bad, err = (n .. )
(bad == (err) == , )
, )
(, , (r)
lf = ()
lf
(path)
fn, err = (path)
fn (err, )
()
, (f)
()
n = () ..
resolved.(n, )
(() resolved.(n) == )
ok, v = (f, n)
(n)
(ok v == , )
, )
_, n ({ , , , })
(n, , () b64enc , (f)
(() == , )
(() == , )
(() == , )
(() == , )
(() == , )
bytes = {}; i = , bytes[#bytes + ] = .(i)
(#(.(bytes)) == , )
, )
_, n ({ , , , })
(n, , () b64dec , (f)
(() == , )
(() == , )
(() == , )
(() == , )
bytes = {}; i = , bytes[#bytes + ] = .(i)
raw = .(bytes)
(((raw)) == raw, )
, )
(, , ()
(n)
n = .((n) )
n < n > (, )
((n))
, (f)
r = ()
((r) == #(r) == , )
(() ~= r, )
, )
(, , () () (()) , (f)
r = ()
((r) == #(r) == , )
, )
(, , () hashFn , (f)
((, ):() == , )
((, ):() == , )
((, ):() == , )
((, ):() == , )
ok1, h1 = (f, , )
ok1 (h1) ==
(h1:() == , )
ok2, h2 = (f, , )
ok2 (h2) ==
(h2:():(, ) == , )
, )
(, , () encryptFn , (f)
key = (())
enc, iv = (, key, , )
((enc) == (iv) == , )
()
(resolved[](enc, key, iv, ) == , )
, )
(, , () decryptFn , (f)
()
key = (())
enc, iv = resolved[](, key, , )
((enc, key, iv, ) == , )
, )
(, , () lz4compress , (f)
()
d = .(, ) ..
c = (d)
((c) == , )
(resolved.(c, #d) == d, )
, )
(, , () lz4decompress , (f)
()
d = .(, ) ..
((resolved.(d), #d) == d, )
, )
(a, b)
a, b = a % , b %
ah, al = .(a / ), a %
((ah * b) % * + al * b) %
(a)
a = a %
(bit32.(bit32.(a % , ), bit32.(bit32.(a, ) % , ),
bit32.(bit32.(a, ) % , ), bit32.(a, ) % ))
bitDefs = {
{ , (a, b) (bit32.(a, b)) , { , }, },
{ , (a, b) (bit32.(a, b)) , { , }, },
{ , (a, b) (bit32.(a, b)) , { , }, },
{ , (a) (bit32.(a)) , { }, - },
{ , (a, b) (bit32.(a, b)) , { , }, },
{ , (a, b) (bit32.(a, b)) , { , }, },
{ , (a, b) (bit32.(a, b)) , { -, }, - },
{ , (a, b) (bit32.(a, b)) , { , }, - },
{ , (a, b) (bit32.(a, b)) , { , }, - },
{ , (a) (a) , { }, - },
{ , (a, n)
n = n
s = .(, a % )
s:(-n)
, { , }, },
{ , (a, b) (a + b) , { , }, },
{ , (a, b) (a - b) , { , }, },
{ , (a, b) ((a, b)) , { , }, },
{ , (a, b) (.((a % ) / (b % ))) , { , }, },
{ , bswap32, { }, },
{ , (a, b) bit32.(a, b) , { , }, },
}
_, d (bitDefs)
bs = ( .. d[], , () d[] , (f)
r = (.(d[]))
d[] ==
((r) == r:():(, ) == , .. (r))
(r == d[], .. (d[]) .. .. (r))
, )
d[] == d[] == d[] == bs.force =
(, , ()
(opts)
(opts) ~= (opts.Url) ~= (, )
method = (opts.Method ):()
ok, res = (()
HttpService:({ Url = opts.Url, Method = method, Headers = opts.Headers, Body = opts.Body })
)
ok (res) ==
{ Success = res.Success, StatusCode = res.StatusCode, StatusMessage = res.StatusMessage,
Headers = res.Headers {}, Body = res.Body }
method ==
ok2, body = (() :(opts.Url) )
ok2
{ Success = , StatusCode = , StatusMessage = , Headers = {}, Body = body }
res = body
{ Success = , StatusCode = , StatusMessage = (res), Headers = {}, Body = }
, (f)
( (f), )
bad, badErr = (f, { Url = , Method = })
( bad (badErr):(, , ) ~= , )
_, m ({ , })
r = ({ Url = "https://example.invalid", Method = m })
expect(type(r) == "table", m .. ": response is not a table")
expect(type(r.Success) == "boolean", m .. ": Success must be boolean")
expect(type(r.StatusCode) == "number", m .. ": StatusCode must be numeric")
expect(type(r.Headers) == "table", m .. ": Headers must be a table")
expect(type(r.Body) == "string", m .. ": Body must be a string")
end
end, "HttpService:RequestAsync, falls back to HttpGet; live network test excluded")
alias("http_request", "request", "Network")
alias("http.request", "request", "Network")
natives("Network", { "WebSocket.connect" })
local VIM
local function vim()
if VIM == nil then
local ok, s = pcall(function() return game:GetService("VirtualInputManager") end)
VIM = (ok and s) or false
end
return VIM or nil
end
local function needVim()
local v = vim()
if not v then error("VirtualInputManager unavailable", 3) end
return v
end
local function mouseBtn(btn, down, up)
return function(x, y)
local v = needVim()
local pos = UserInputSvc:GetMouseLocation()
x, y = tonumber(x) or pos.X, tonumber(y) or pos.Y
if down then v:SendMouseButtonEvent(x, y, btn, true, game, 1) end
if up then v:SendMouseButtonEvent(x, y, btn, false, game, 1) end
end
end
local function toKey(code)
if typeof(code) == "EnumItem" then return code end
if type(code) == "number" then
for _, k in ipairs(Enum.KeyCode:GetEnumItems()) do
if k.Value == code then return k end
end
end
if type(code) == "string" and Enum.KeyCode[code] then return Enum.KeyCode[code] end
error("invalid key code", 3)
end
local inputTest = function(f)
expect(type(f) == "function", "not a function")
expect(vim() ~= nil, "VirtualInputManager unavailable")
end
local inputDefs = {
{ "mouse1click", mouseBtn(0, true, true) }, { "mouse1press", mouseBtn(0, true, false) },
{ "mouse1release", mouseBtn(0, false, true) }, { "mouse2click", mouseBtn(1, true, true) },
{ "mouse2press", mouseBtn(1, true, false) }, { "mouse2release", mouseBtn(1, false, true) },
{ "mousemoveabs", function(x, y) needVim():SendMouseMoveEvent(tonumber(x) or 0, tonumber(y) or 0, game) end },
{ "mousemoverel", function(dx, dy)
local p = UserInputSvc:GetMouseLocation()
needVim():SendMouseMoveEvent(p.X + (tonumber(dx) or 0), p.Y + (tonumber(dy) or 0), game)
end },
{ "mousescroll", function(px)
local p = UserInputSvc:GetMouseLocation()
needVim():SendMouseWheelEvent(p.X, p.Y, (tonumber(px) or 0) > 0, game)
end },
{ "keypress", function(code) needVim():SendKeyEvent(true, toKey(code), false, game) end },
{ "keyrelease", function(code) needVim():SendKeyEvent(false, toKey(code), false, game) end },
}
for _, d in ipairs(inputDefs) do
local fn = d[2]
def(d[1], "Input", function() if vim() then return fn end return nil end, inputTest,
"VirtualInputManager (behavior not exercised to avoid real input)")
end
local drawGui
local drawObjs = {}
local renderObjs = setmetatable({}, { __mode = "k" })
local function getDrawGui()
if drawGui and drawGui.Parent then return drawGui end
drawGui = Instance.new("ScreenGui")
drawGui.Name = "HyundaxIUMDrawing"
drawGui.IgnoreGuiInset = true
drawGui.ResetOnSpawn = false
drawGui.DisplayOrder = 2147483647
drawGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
local ok = pcall(function() drawGui.Parent = CoreGui end)
if not ok then
local gh = grab("gethui")
pcall(function() drawGui.Parent = (type(gh) == "function") and gh() or CoreGui end)
end
return drawGui
end
local DRAW_FONTS = { [0] = Enum.Font.Arial, [1] = Enum.Font.SourceSans, [2] = Enum.Font.Code, [3] = Enum.Font.RobotoMono }
local function drawDefaults(kind)
local st = {
Visible = false, Color = Color3.new(1, 1, 1), Transparency = 1, ZIndex = 0, Thickness = 1,
Filled = false, Position = Vector2.new(), Size = Vector2.new(), From = Vector2.new(), To = Vector2.new(),
Radius = 0, NumSides = 0, Text = "", Font = 0, Center = false, Outline = false,
OutlineColor = Color3.new(), PointA = Vector2.new(), PointB = Vector2.new(), PointC = Vector2.new(),
PointD = Vector2.new(), Rounding = 0, Data = "", Transparency_ = 1,
}
if kind == "Text" then st.Size = 13 end
return st
end
local PROP_ALLOWED = {
Line = { "Visible", "Color", "Transparency", "ZIndex", "Thickness", "From", "To" },
Square = { "Visible", "Color", "Transparency", "ZIndex", "Thickness", "Filled", "Position", "Size" },
Circle = { "Visible", "Color", "Transparency", "ZIndex", "Thickness", "Filled", "Position", "Radius", "NumSides" },
Text = { "Visible", "Color", "Transparency", "ZIndex", "Text", "Size", "Font", "Center", "Outline", "OutlineColor", "Position", "TextBounds" },
Triangle = { "Visible", "Color", "Transparency", "ZIndex", "Thickness", "Filled", "PointA", "PointB", "PointC" },
Quad = { "Visible", "Color", "Transparency", "ZIndex", "Thickness", "Filled", "PointA", "PointB", "PointC", "PointD" },
Image = { "Visible", "Color", "Transparency", "ZIndex", "Position", "Size", "Rounding", "Data" },
}
local function newDrawing(kind)
if type(kind) ~= "string" or not PROP_ALLOWED[kind] then
error("invalid drawing type: " .. tostring(kind), 2)
end
local st = drawDefaults(kind)
local allowed = {}
for _, k in ipairs(PROP_ALLOWED[kind]) do allowed[k] = true end
local gui = getDrawGui()
local root = Instance.new("Frame")
root.Name = kind
root.BackgroundTransparency = 1
root.BorderSizePixel = 0
root.Size = UDim2.fromScale(1, 1)
root.Visible = false
root.Parent = gui
local pool = {}
local removed = false
local textLabel, imageLabel, shape, stroke, corner
local function line(idx, a, b)
local fr = pool[idx]
if not fr then
fr = Instance.new("Frame")
fr.BorderSizePixel = 0
fr.AnchorPoint = Vector2.new(0.5, 0.5)
fr.Parent = root
pool[idx] = fr
end
local d = b - a
fr.Visible = true
fr.BackgroundColor3 = st.Color
fr.BackgroundTransparency = 1 - st.Transparency
fr.Size = UDim2.fromOffset(d.Magnitude, math.max(st.Thickness, 1))
fr.Position = UDim2.fromOffset((a.X + b.X) / 2, (a.Y + b.Y) / 2)
fr.Rotation = math.deg(math.atan2(d.Y, d.X))
fr.ZIndex = st.ZIndex
end
local function hideFrom(idx)
for i = idx, #pool do if pool[i] then pool[i].Visible = false end end
end
local function render()
if removed then return end
root.Visible = st.Visible and true or false
root.ZIndex = st.ZIndex
if kind == "Line" then
line(1, st.From, st.To); hideFrom(2)
elseif kind == "Triangle" then
line(1, st.PointA, st.PointB); line(2, st.PointB, st.PointC); line(3, st.PointC, st.PointA); hideFrom(4)
elseif kind == "Quad" then
line(1, st.PointA, st.PointB); line(2, st.PointB, st.PointC)
line(3, st.PointC, st.PointD); line(4, st.PointD, st.PointA); hideFrom(5)
elseif kind == "Square" or kind == "Circle" then
if not shape then
shape = Instance.new("Frame")
shape.BorderSizePixel = 0
shape.Parent = root
stroke = Instance.new("UIStroke"); stroke.Parent = shape
if kind == "Circle" then
corner = Instance.new("UICorner"); corner.CornerRadius = UDim.new(1, 0); corner.Parent = shape
end
end
if kind == "Square" then
shape.AnchorPoint = Vector2.new(0, 0)
shape.Position = UDim2.fromOffset(st.Position.X, st.Position.Y)
shape.Size = UDim2.fromOffset(st.Size.X, st.Size.Y)
else
shape.AnchorPoint = Vector2.new(0.5, 0.5)
shape.Position = UDim2.fromOffset(st.Position.X, st.Position.Y)
shape.Size = UDim2.fromOffset(st.Radius * 2, st.Radius * 2)
end
shape.ZIndex = st.ZIndex
shape.BackgroundColor3 = st.Color
shape.BackgroundTransparency = st.Filled and (1 - st.Transparency) or 1
stroke.Enabled = not st.Filled
stroke.Color = st.Color
stroke.Thickness = st.Thickness
stroke.Transparency = 1 - st.Transparency
elseif kind == "Text" then
if not textLabel then
textLabel = Instance.new("TextLabel")
textLabel.BackgroundTransparency = 1
textLabel.AutomaticSize = Enum.AutomaticSize.XY
textLabel.Parent = root
end
textLabel.Text = tostring(st.Text)
textLabel.TextSize = tonumber(st.Size) or 13
textLabel.Font = DRAW_FONTS[st.Font] or Enum.Font.Arial
textLabel.TextColor3 = st.Color
textLabel.TextTransparency = 1 - st.Transparency
textLabel.TextStrokeColor3 = st.OutlineColor
textLabel.TextStrokeTransparency = st.Outline and 0 or 1
textLabel.AnchorPoint = Vector2.new(st.Center and 0.5 or 0, 0)
textLabel.Position = UDim2.fromOffset(st.Position.X, st.Position.Y)
textLabel.ZIndex = st.ZIndex
elseif kind == "Image" then
if not imageLabel then
imageLabel = Instance.new("ImageLabel")
imageLabel.BackgroundTransparency = 1
imageLabel.BorderSizePixel = 0
imageLabel.Parent = root
corner = Instance.new("UICorner"); corner.Parent = imageLabel
end
imageLabel.Position = UDim2.fromOffset(st.Position.X, st.Position.Y)
imageLabel.Size = UDim2.fromOffset(st.Size.X, st.Size.Y)
imageLabel.ImageColor3 = st.Color
imageLabel.ImageTransparency = 1 - st.Transparency
imageLabel.ZIndex = st.ZIndex
corner.CornerRadius = UDim.new(0, st.Rounding)
if type(st.Data) == "string" and st.Data:find("^rbxasset") then imageLabel.Image = st.Data end
end
end
local function remove()
if removed then return end
removed = true
drawObjs[st] = nil
pcall(function() root:Destroy() end)
end
local proxy = setmetatable({}, {
__index = function(_, k)
if k == "Remove" or k == "Destroy" then return remove end
if k == "TextBounds" and textLabel then return Vector2.new(textLabel.TextBounds.X, textLabel.TextBounds.Y) end
if allowed[k] then return st[k] end
return nil
end,
__newindex = function(_, k, v)
if removed then error("drawing object has been removed", 2) end
if not allowed[k] or k == "TextBounds" then error("invalid drawing property: " .. tostring(k), 2) end
st[k] = v
render()
end,
})
drawObjs[st] = remove
renderObjs[proxy] = true
render()
return proxy
end
def("Drawing.new", "Drawing", function() return newDrawing end, function(f)
local sq = f("Square")
expect(type(sq) == "table" or typeof(sq) == "userdata", "bad object")
sq.Size = Vector2.new(10, 10)
sq.Visible = true
local okProps = sq.Visible == true and sq.Size == Vector2.new(10, 10)
sq.Visible = false
sq:Remove()
expect(okProps, "property round trip failed")
end, "ScreenGui-backed (Image Data needs rbxasset ids)")
def("Drawing.Fonts", "Drawing", function()
return { UI = 0, System = 1, Plex = 2, Monospace = 3 }
end, function(f)
expect(type(f) == "table" and f.UI == 0 and f.Monospace == 3, "bad font table")
end, "font enum table").value = true
def("cleardrawcache", "Drawing", function()
return function()
local list = {}
for _, rm2 in pairs(drawObjs) do list[#list + 1] = rm2 end
for _, rm2 in ipairs(list) do rm2() end
if drawGui then pcall(function() drawGui:ClearAllChildren() end) end
end
end, function(f)
need("Drawing.new")
resolved["Drawing.new"]("Line")
expect(pcall(f), "cleardrawcache errored")
end)
def("isrenderobj", "Drawing", function()
return function(o) return renderObjs[o] == true end
end, function(f)
need("Drawing.new")
local o = resolved["Drawing.new"]("Circle")
local ok = f(o) == true
o.Visible = false
o:Remove()
expect(ok, "drawing not recognised")
end)
def("getrenderproperty", "Drawing", function()
return function(o, k)
if renderObjs[o] ~= true then error("render object expected", 2) end
return o[k]
end
end, function(f)
need("Drawing.new")
local o = resolved["Drawing.new"]("Square")
o.Thickness = 3
local ok = f(o, "Thickness") == 3
o.Visible = false
o:Remove()
expect(ok, "wrong value")
end)
def("setrenderproperty", "Drawing", function()
return function(o, k, v)
if renderObjs[o] ~= true then error("render object expected", 2) end
o[k] = v
end
end, function(f)
need("Drawing.new")
local o = resolved["Drawing.new"]("Square")
f(o, "Thickness", 4)
local ok = o.Thickness == 4
o.Visible = false
o:Remove()
expect(ok, "property not set")
end)
local function T(name, fn)
local sp = byName[name]
if sp then sp.test = fn end
end
local function skip(why) return "skip:" .. why end
local function existOnly(name)
T(name, function(f) expect(type(f) == "function", "not a function") end)
end
local function probeScript(classes)
local lp = game:GetService("Players").LocalPlayer
local ps = lp and lp:FindFirstChildOfClass("PlayerScripts")
if ps then
for _, d in ipairs(ps:GetDescendants()) do
for _, c in ipairs(classes) do if d:IsA(c) then return d end end
end
end
return nil
end
local function rootPart()
local lp = game:GetService("Players").LocalPlayer
local ch = lp and lp.Character
return ch and ch:FindFirstChild("HumanoidRootPart")
end
T("getgc", function(f)
local t = f()
expect(type(t) == "table" and #t > 0, "empty result")
end)
T("getreg", function(f) expect(type(f()) == "table", "not a table") end)
T("getsenv", function(f)
local cands = {}
local lp = game:GetService("Players").LocalPlayer
local ch = lp and lp.Character
local anim = ch and ch:FindFirstChild("Animate")
if anim then cands[#cands + 1] = anim end
local ps = lp and lp:FindFirstChildOfClass("PlayerScripts")
if ps then
for _, d in ipairs(ps:GetDescendants()) do
if d:IsA("LocalScript") or d:IsA("ModuleScript") then cands[#cands + 1] = d end
end
end
local grs = grab("getrunningscripts")
if type(grs) == "function" then
local okr, list = pcall(grs)
if okr and type(list) == "table" then
for _, d in ipairs(list) do cands[#cands + 1] = d end
end
end
if #cands == 0 then return skip("no script to inspect") end
local passed = false
for ci, sc in ipairs(cands) do
if ci > 4 then break end
local ok, env = pcall(f, sc)
if ok and type(env) == "table" then passed = true; break end
end
expect(passed, "environment is not a table")
end)
T("getscriptclosure", function(f)
local sc = probeScript({ "LocalScript", "ModuleScript" })
if not sc then return skip("no script to inspect") end
expect(type(f(sc)) == "function", "not a function")
end)
T("getscriptbytecode", function(f)
local sc = probeScript({ "LocalScript", "ModuleScript" })
if not sc then return skip("no script to inspect") end
expect(type(f(sc)) == "string", "not a string")
end)
T("getscripthash", function(f)
local sc = probeScript({ "LocalScript", "ModuleScript" })
if not sc then return skip("no script to inspect") end
local h = f(sc)
expect(type(h) == "string" and #h > 0, "empty hash")
expect(f(sc) == h, "hash not stable")
end)
T("decompile", function(f)
local sc = probeScript({ "LocalScript", "ModuleScript" })
if not sc then return skip("no script to inspect") end
expect(type(f(sc)) == "string", "not a string")
end)
T("getfunctionhash", function(f)
local fn = function() return 1 end
local h = f(fn)
expect(type(h) == "string" and #h > 0, "empty hash")
expect(f(fn) == h, "hash not stable")
end)
T("getnilinstances", function(f)
local p = Instance.new("Part")
p.Name = "hx_nil_probe"
p.Parent = workspace
p.Parent = nil
local found = false
for _, i in ipairs(f()) do if i == p then found = true; break end end
p:Destroy()
expect(found, "nil-parented instance not listed")
end)
T("getconnections", function(f)
local be = Instance.new("BindableEvent")
local c = be.Event:Connect(function() end)
local cons = f(be.Event)
c:Disconnect()
be:Destroy()
expect(type(cons) == "table" and #cons >= 1, "connection not listed")
end)
T("firesignal", function(f)
local got
local be = Instance.new("BindableEvent")
local c = be.Event:Connect(function(v) got = v end)
f(be.Event, 5)
waitFor(function() return got == 5 end, 1)
c:Disconnect()
be:Destroy()
expect(got == 5, "signal not fired")
end)
T("setscriptable", function(f)
need("isscriptable")
local fire = Instance.new("Fire")
f(fire, "size_xml", true)
local on = resolved.isscriptable(fire, "size_xml") == true
f(fire, "size_xml", false)
local off = resolved.isscriptable(fire, "size_xml") == false
fire:Destroy()
expect(on, "property did not become scriptable")
expect(off, "property did not become unscriptable")
end)
T("fireclickdetector", function(f)
local part = Instance.new("Part")
part.Anchored = true
part.Parent = workspace
local cd = Instance.new("ClickDetector")
cd.Parent = part
local fired = false
cd.MouseClick:Connect(function() fired = true end)
f(cd)
waitFor(function() return fired end, 1)
part:Destroy()
expect(fired, "MouseClick not fired")
end)
T("fireproximityprompt", function(f)
local part = Instance.new("Part")
part.Anchored = true
part.Parent = workspace
local pp = Instance.new("ProximityPrompt")
pp.Parent = part
local fired = false
pp.Triggered:Connect(function() fired = true end)
f(pp)
waitFor(function() return fired end, 1)
part:Destroy()
expect(fired, "Triggered not fired")
end)
T("firetouchinterest", function(f)
local root = rootPart()
if not root then return skip("no character to touch with") end
local part = Instance.new("Part")
part.Anchored = true
part.CanTouch = true
part.Position = Vector3.new(0, 5000, 0)
part.Parent = workspace
local touched = false
part.Touched:Connect(function() touched = true end)
f(root, part, 0)
f(root, part, 1)
waitFor(function() return touched end, 1)
part:Destroy()
expect(touched, "Touched not fired")
end)
T("getcallbackvalue", function(f)
local bf = Instance.new("BindableFunction")
local fn = function() return 1 end
bf.OnInvoke = fn
local v = f(bf, "OnInvoke")
bf:Destroy()
expect(v == fn, "wrong callback")
end)
T("getactors", function(f) expect(type(f()) == "table", "not a table") end)
T("getfpscap", function(f) expect(type(f()) == "number", "not a number") end)
T("setfpscap", function(f)
need("getfpscap")
local old = resolved.getfpscap()
f(30)
task.wait(0.1)
local ok = resolved.getfpscap() == 30
f(old)
expect(ok, "cap did not change")
end)
T("getcustomasset", function(f)
local ws = byName.writefile
if not ws or ws.src ~= "native" then return skip("needs a working native filesystem") end
local n = tmp() .. ".txt"
resolved.writefile(n, "hx")
waitFor(function() return resolved.isfile(n) end, 1)
local a = f(n)
rm(n)
expect(type(a) == "string" and a:find("rbxasset", 1, true) ~= nil, "no rbxasset url")
end)
T("cache.iscached", function(f)
local p = Instance.new("Part")
p.Parent = workspace
local v = f(p)
p:Destroy()
expect(v == true, "fresh instance not cached")
end)
T("cache.invalidate", function(f)
need("cache.iscached")
local p = Instance.new("Part")
p.Parent = workspace
f(p)
local v = resolved["cache.iscached"](p)
p:Destroy()
expect(v == false, "instance still cached")
end)
T("hookfunction", function(f)
local function a() return "a" end
local function b() return "b" end
local old = f(a, b)
local hooked = a() == "b"
local orig = type(old) == "function" and old() == "a"
local rf = resolved.restorefunction
if rf then pcall(rf, a) end
expect(hooked, "hook not applied")
expect(orig, "original not returned")
end)
T("restorefunction", function(f)
need("hookfunction")
local function a() return "a" end
resolved.hookfunction(a, function() return "b" end)
expect(a() == "b", "setup: hook not applied")
f(a)
expect(a() == "a", "function not restored")
end)
T("setreadonly", function(f)
local t = table.freeze({ a = 1 })
f(t, false)
local ok = pcall(function() t.a = 2 end)
expect(ok and t.a == 2, "table still readonly")
end)
T("debug.getupvalue", function(f)
local x = 5
x = x + 0
local function fn() return x end
expect(f(fn, 1) == 5, "wrong upvalue")
end)
T("debug.getupvalues", function(f)
local x = 5
x = x + 0
local function fn() return x end
local u = f(fn)
expect(type(u) == "table" and u[1] == 5, "wrong upvalues")
end)
T("debug.setupvalue", function(f)
local x = 5
x = x + 0
local function fn() return x end
f(fn, 1, 9)
expect(fn() == 9, "upvalue not changed")
end)
T("debug.getconstant", function(f)
local function fn() return "hx_const_probe" end
local found = false
for i = 1, 8 do
local ok, v = pcall(f, fn, i)
if ok and v == "hx_const_probe" then found = true; break end
end
expect(found, "constant not found")
end)
T("debug.getconstants", function(f)
local function fn() return "hx_const_probe", 12345 end
local c = f(fn)
expect(type(c) == "table" and table.find(c, "hx_const_probe") ~= nil, "constant not found")
end)
T("debug.setconstant", function(f)
need("debug.getconstant")
local function fn() return "hx_const_a" end
for i = 1, 8 do
local ok, v = pcall(resolved["debug.getconstant"], fn, i)
if ok and v == "hx_const_a" then f(fn, i, "hx_const_b"); break end
end
expect(fn() == "hx_const_b", "constant not changed")
end)
T("debug.getproto", function(f)
local function fn() local function inner() return 1 end return inner end
local keep = fn()
local ok, p = pcall(f, fn, 1)
if ok and (type(p) == "function" or type(p) == "table") then return end
local ok2, p2 = pcall(f, fn, 1, true)
expect(ok2 and (type(p2) == "function" or (type(p2) == "table" and next(p2) ~= nil)), "no proto returned")
expect(keep ~= nil, "closure lost")
end)
T("debug.getprotos", function(f)
local function fn() local function inner() end return inner end
expect(type(f(fn)) == "table", "not a table")
end)
T("debug.getstack", function(f) expect(f(1) ~= nil, "no stack") end)
T("debug.getregistry", function(f) expect(type(f()) == "table", "not a table") end)
T("debug.getmetatable", function(f) expect(type(f(game)) == "table", "no metatable") end)
T("debug.setmetatable", function(f)
local t = {}
f(t, { __index = function() return 7 end })
expect(t.x == 7, "metatable not set")
end)
local function member(o, k)
local ok, v = pcall(function() return o[k] end)
return ok and v or nil
end
T("setclipboard", function(f)
local get = grab("getclipboard")
local prev
if type(get) == "function" then pcall(function() prev = get() end) end
local probe = "hx_clip_" .. tostring(rng:NextInteger(1000, 9999))
f(probe)
if type(get) == "function" then
local ok, v = pcall(get)
if ok and type(v) == "string" then
expect(waitFor(function() local o, x = pcall(get); return o and x == probe end, 1), "clipboard not updated")
end
end
if type(prev) == "string" then pcall(f, prev) end
end)
T("setrbxclipboard", function(f)
local ok, err = pcall(f, "hx_rbx_clip_probe")
expect(ok, tostring(err))
end)
T("queue_on_teleport", function(f)
local ok, err = pcall(f, "-- hyundax compat probe")
expect(ok, tostring(err))
end)
T("run_on_actor", function(f)
local ga = grab("getactors")
if type(ga) ~= "function" then return skip("getactors unavailable") end
local okA, actors = pcall(ga)
local actor = okA and type(actors) == "table" and actors[1] or nil
local temp
if not actor then
temp = Instance.new("Actor")
temp.Parent = workspace
actor = temp
end
local ok, err = pcall(f, actor, "local x = 1 + 1")
if temp then pcall(function() temp:Destroy() end) end
if not ok and temp then return skip("no usable Actor in this game: " .. tostring(err)) end
expect(ok, tostring(err))
end)
T("WebSocket.connect", function(f)
local ws, err, finished
task.spawn(function()
local ok, r = pcall(f, "wss://echo.websocket.events")
if ok then ws = r else err = r end
finished = true
end)
waitFor(function() return finished end, 4)
if not ws then return skip("could not connect (" .. tostring(err or "timeout") .. ")") end
local got
local om = member(ws, "OnMessage")
if om and type(member(om, "Connect")) == "function" then
pcall(function() om:Connect(function(m) got = m end) end)
end
local okSend, errSend = pcall(function() ws:Send("hx_ws_probe") end)
waitFor(function() return got ~= nil end, 1.5)
pcall(function() ws:Close() end)
expect(type(member(ws, "Send")) == "function" and type(member(ws, "Close")) == "function", "missing Send/Close")
expect(om ~= nil and member(ws, "OnClose") ~= nil, "missing OnMessage/OnClose")
expect(okSend, tostring(errSend))
end)
T("getnamecallmethod", function(f)
need("hookmetamethod")
local hook = resolved.hookmetamethod
local calls, ref = {}, nil
ref = hook(game, "__namecall", function(...)
if #calls < 20 and (...) == game then calls[#calls + 1] = f() end
return ref(...)
end)
local okc = pcall(function() return game:GetService("Lighting") end)
pcall(hook, game, "__namecall", ref)
expect(okc, "namecall failed under hook")
expect(table.find(calls, "GetService") ~= nil, "expected GetService, got " .. tostring(calls[1]))
end)
T("setnamecallmethod", function(f)
need("hookmetamethod")
local hook = resolved.hookmetamethod
local gm = resolved.getnamecallmethod
local ref, armed = nil, true
ref = hook(game, "__namecall", function(...)
if armed and (...) == game then
local okm, m = true, "GetService"
if gm then okm, m = pcall(gm) end
if okm and m == "GetService" then
armed = false
f("GetChildren")
end
end
return ref(...)
end)
local ok, res = pcall(function() return game:GetService("Lighting") end)
armed = false
pcall(hook, game, "__namecall", ref)
expect(ok, "namecall failed under hook")
expect(type(res) == "table", "method was not replaced (got " .. typeof(res) .. ")")
end)
T("debug.setstack", function(f)
need("debug.getstack")
local getstack = resolved["debug.getstack"]
local probe = "hx_stack_" .. tostring(rng:NextInteger(100000, 999999))
local idx
local okS, snap = pcall(getstack, 1)
if okS and type(snap) == "table" then
for i, v in pairs(snap) do if v == probe then idx = i; break end end
end
if not idx then
for i = 1, 24 do
local ok, v = pcall(getstack, 1, i)
if ok and v == probe then idx = i; break end
end
end
expect(idx ~= nil, "could not locate a local on the stack")
f(1, idx, "hx_stack_changed")
expect(probe == "hx_stack_changed", "stack value not changed")
end)
T("cache.replace", function(f)
local part = Instance.new("Part")
local fire = Instance.new("Fire")
local ok, err = pcall(f, part, fire)
expect(ok, tostring(err))
expect(part ~= fire, "objects still equal")
pcall(function() part:Destroy() end)
pcall(function() fire:Destroy() end)
end)
T("messagebox", function(f)
if byName.messagebox.src == "poly" then
local result, done
task.spawn(function()
local ok, r = pcall(f, "Hyundax IUM compat test", "Hyundax IUM", 4)
if ok then result = r end
done = true
end)
waitFor(function() return Compat.mb.active ~= nil or done end, 2)
expect(Compat.mb.active ~= nil, "dialog did not open")
Compat.mb.active.close(6)
waitFor(function() return done end, 2)
expect(result == 6, "expected button result 6")
return
end
if not CONFIG.compat.intrusive then return skip("enable Intrusive tests (shows a dialog)") end
local result, err, done
task.spawn(function()
local ok, r = pcall(f, "Hyundax IUM compat test - click OK", "Hyundax IUM", 0)
if ok then result = r else err = r end
done = true
end)
waitFor(function() return done end, 5)
expect(err == nil, tostring(err))
if done then expect(type(result) == "number", "expected a number result") end
end)
T("saveinstance", function(f)
if not CONFIG.compat.intrusive then return skip("enable Intrusive tests (writes a file)") end
local folder = Instance.new("Folder")
folder.Name = "hx_save_probe"
Instance.new("Part", folder)
local name = "hx_saveprobe" .. tostring(rng:NextInteger(1000, 9999))
local ok, err = pcall(f, { Object = folder, FileName = name, mode = "optimized", noscripts = true })
pcall(function() folder:Destroy() end)
expect(ok, tostring(err))
end)
def("printidentity", "Environment", function()
return function() print("Current identity is " .. tostring(identity)) end
end, function(f) expect(pcall(f), "errored") end, "prints the emulated identity")
def("getexecutorversion", "Environment", function() return function() return BRAND.ver end end,
function(f) expect(type(f()) == "string", "not a string") end, "reports Hyundax IUM version")
def("newlclosure", "Closures", function()
return function(fn)
if type(fn) ~= "function" then error("function expected", 2) end
return function(...) return fn(...) end
end
end, function(f)
local fn = function() return 3 end
local c = f(fn)
expect(c ~= fn and c() == 3, "wrapper misbehaves")
need("islclosure")
expect(resolved.islclosure(c) == true, "not a Lua closure")
end, "Lua wrapper")
Compat.hss = { hooked = setmetatable({}, { __mode = "k" }), store = {} }
Compat.hss.d = function(name, fn, test, note)
def(name, "HSS", function() return fn end, test, note)
end
Compat.hss.apply = function(f, new)
local hf = resolved.hookfunction
if type(hf) ~= "function" then error("hookfunction unavailable", 3) end
if type(f) ~= "function" or type(new) ~= "function" then error("function expected", 3) end
local st = Compat.hss.hooked[f]
if st then
st.new = new
return st.orig
end
st = { calls = 0, new = new }
st.orig = hf(f, function(...)
st.calls = st.calls + 1
return st.new(...)
end)
Compat.hss.hooked[f] = st
return st.orig
end
Compat.hss.restore = function(f)
local st = Compat.hss.hooked[f]
if not st then return false end
local ok = false
local rf = resolved.restorefunction
if type(rf) == "function" then ok = pcall(rf, f) end
if not ok and type(resolved.hookfunction) == "function" then
ok = pcall(resolved.hookfunction, f, st.orig)
end
Compat.hss.hooked[f] = nil
return ok
end
Compat.hss.needHook = function()
if type(resolved.hookfunction) ~= "function" then return skip("needs hookfunction") end
end
Compat.hss.d("hss.hook.apply", function(f, new) return Compat.hss.apply(f, new) end, function(f)
local s = Compat.hss.needHook() if s then return s end
local function a() return "a" end
local old = f(a, function() return "b" end)
local hooked = a() == "b"
local orig = type(old) == "function" and old() == "a"
Compat.hss.restore(a)
expect(hooked, "hook not applied")
expect(orig, "original not returned")
end, "hookfunction wrapper that tracks state")
Compat.hss.d("hss.hook.isHooked", function(f) return Compat.hss.hooked[f] ~= nil end, function(f)
local s = Compat.hss.needHook() if s then return s end
local function a() return 1 end
local before = f(a)
Compat.hss.apply(a, function() return 2 end)
local during = f(a)
Compat.hss.restore(a)
expect(before == false and during == true, "wrong hooked state")
expect(f(a) == false, "still reported hooked")
end)
Compat.hss.d("hss.hook.original", function(f)
local st = Compat.hss.hooked[f]
return st and st.orig or nil
end, function(f)
local s = Compat.hss.needHook() if s then return s end
local function a() return "a" end
Compat.hss.apply(a, function() return "b" end)
local o = f(a)
local ok = type(o) == "function" and o() == "a"
Compat.hss.restore(a)
expect(ok, "original not returned")
end)
Compat.hss.d("hss.hook.restore", function(f) return Compat.hss.restore(f) end, function(f)
local s = Compat.hss.needHook() if s then return s end
local function a() return "a" end
Compat.hss.apply(a, function() return "b" end)
local r = f(a)
expect(a() == "a", "function not restored")
expect(r == true, "restore did not report success")
end)
Compat.hss.d("hss.hook.restoreAll", function()
local list = {}
for fn in pairs(Compat.hss.hooked) do list[#list + 1] = fn end
local n = 0
for _, fn in ipairs(list) do
if Compat.hss.restore(fn) then n = n + 1 end
end
return n
end, function(f)
local s = Compat.hss.needHook() if s then return s end
local function a() return "a" end
local function b() return "b" end
Compat.hss.apply(a, function() return 1 end)
Compat.hss.apply(b, function() return 2 end)
local n = f()
expect(a() == "a" and b() == "b", "functions not restored")
expect(n >= 2, "count too small")
end)
Compat.hss.d("hss.hook.list", function()
local list = {}
for fn in pairs(Compat.hss.hooked) do list[#list + 1] = fn end
return list
end, function(f)
local s = Compat.hss.needHook() if s then return s end
local function a() return 1 end
Compat.hss.apply(a, function() return 2 end)
local found = false
for _, fn in ipairs(f()) do if fn == a then found = true end end
Compat.hss.restore(a)
expect(found, "hooked function not listed")
end)
Compat.hss.d("hss.hook.before", function(f, cb)
if type(cb) ~= "function" then error("function expected", 2) end
local orig
orig = Compat.hss.apply(f, function(...)
cb(...)
return orig(...)
end)
return orig
end, function(f)
local s = Compat.hss.needHook() if s then return s end
local seen
local function a(x) return x * 2 end
f(a, function(x) seen = x end)
local r = a(4)
Compat.hss.restore(a)
expect(seen == 4, "callback not run")
expect(r == 8, "original result changed")
end)
Compat.hss.d("hss.hook.after", function(f, cb)
if type(cb) ~= "function" then error("function expected", 2) end
local orig
orig = Compat.hss.apply(f, function(...)
local r = table.pack(orig(...))
cb(...)
return table.unpack(r, 1, r.n)
end)
return orig
end, function(f)
local s = Compat.hss.needHook() if s then return s end
local seen
local function a(x) return x + 1 end
f(a, function(x) seen = x end)
local r = a(4)
Compat.hss.restore(a)
expect(seen == 4, "callback not run")
expect(r == 5, "original result changed")
end)
Compat.hss.d("hss.hook.count", function(f)
local st = Compat.hss.hooked[f]
return st and st.calls or 0
end, function(f)
local s = Compat.hss.needHook() if s then return s end
local function a() return 1 end
Compat.hss.apply(a, function() return 2 end)
a() a()
local n = f(a)
Compat.hss.restore(a)
expect(n == 2, "expected 2 calls, got " .. tostring(n))
end)
Compat.hss.d("hss.hook.field", function(t, k, new)
if type(t) ~= "table" then error("table expected", 2) end
local old = t[k]
t[k] = new
return old
end, function(f)
local t = { fn = function() return 1 end }
local old = f(t, "fn", function() return 2 end)
expect(t.fn() == 2, "field not replaced")
expect(type(old) == "function" and old() == 1, "original not returned")
end, "pure Lua hook, works without hookfunction")
Compat.hss.d("hss.table.deepclone", function(t)
local seen = {}
local function dc(v)
if type(v) ~= "table" then return v end
if seen[v] then return seen[v] end
local c = {}
seen[v] = c
for k, x in pairs(v) do c[dc(k)] = dc(x) end
return c
end
return dc(t)
end, function(f)
local a = { 1, { 2 } }
a.self = a
local c = f(a)
expect(c ~= a and c[2] ~= a[2] and c[2][1] == 2, "not a deep copy")
expect(c.self == c, "cycle not preserved")
end)
Compat.hss.d("hss.table.merge", function(a, b)
local out = {}
for k, v in pairs(a or {}) do out[k] = v end
for k, v in pairs(b or {}) do out[k] = v end
return out
end, function(f)
local r = f({ a = 1, b = 2 }, { b = 3, c = 4 })
expect(r.a == 1 and r.b == 3 and r.c == 4, "wrong merge")
end)
Compat.hss.d("hss.table.keys", function(t)
local out = {}
for k in pairs(t) do out[#out + 1] = k end
return out
end, function(f)
local k = f({ a = 1, b = 2, c = 3 })
expect(#k == 3, "expected 3 keys")
end)
Compat.hss.d("hss.table.values", function(t)
local out = {}
for _, v in pairs(t) do out[#out + 1] = v end
return out
end, function(f)
local v = f({ a = 10, b = 20 })
expect(#v == 2 and v[1] + v[2] == 30, "wrong values")
end)
Compat.hss.d("hss.table.count", function(t)
local n = 0
for _ in pairs(t) do n = n + 1 end
return n
end, function(f)
expect(f({ 1, 2, a = 3 }) == 3 and f({}) == 0, "wrong count")
end)
Compat.hss.d("hss.table.equals", function(a, b)
local function eq(x, y, seen)
if x == y then return true end
if type(x) ~= "table" or type(y) ~= "table" then return false end
if seen[x] == y then return true end
seen[x] = y
for k, v in pairs(x) do
if not eq(v, y[k], seen) then return false end
end
for k in pairs(y) do
if x[k] == nil then return false end
end
return true
end
return eq(a, b, {})
end, function(f)
expect(f({ 1, { 2 } }, { 1, { 2 } }) == true, "equal tables reported different")
expect(f({ 1, { 2 } }, { 1, { 3 } }) == false, "different tables reported equal")
end)
Compat.hss.d("hss.table.freezeDeep", function(t)
local seen = {}
local function fz(v)
if type(v) ~= "table" or seen[v] then return end
seen[v] = true
for _, x in pairs(v) do fz(x) end
if not table.isfrozen(v) then table.freeze(v) end
end
fz(t)
return t
end, function(f)
local t = f({ a = { b = 1 } })
expect(table.isfrozen(t) and table.isfrozen(t.a), "not frozen")
end)
Compat.hss.d("hss.table.isArray", function(t)
if type(t) ~= "table" then return false end
local n, c = #t, 0
for _ in pairs(t) do c = c + 1 end
return c == n
end, function(f)
expect(f({ 1, 2, 3 }) == true and f({}) == true, "array not detected")
expect(f({ a = 1 }) == false, "dictionary seen as array")
end)
Compat.hss.d("hss.string.split", function(s, sep)
s = tostring(s)
sep = tostring(sep == nil and "," or sep)
local out = {}
if sep == "" then
for i = 1, #s do out[i] = s:sub(i, i) end
return out
end
local pos = 1
while true do
local a, b = s:find(sep, pos, true)
if not a then
out[#out + 1] = s:sub(pos)
break
end
out[#out + 1] = s:sub(pos, a - 1)
pos = b + 1
end
return out
end, function(f)
local r = f("a,b,c", ",")
expect(#r == 3 and r[3] == "c", "wrong split")
local e = f("a,,b", ",")
expect(#e == 3 and e[2] == "", "empty field lost")
end)
Compat.hss.d("hss.string.trim", function(s)
return (tostring(s):match("^%s*(.-)%s*$"))
end, function(f)
expect(f(" hi \n") == "hi", "not trimmed")
end)
Compat.hss.d("hss.string.startswith", function(s, p)
s, p = tostring(s), tostring(p)
return s:sub(1, #p) == p
end, function(f)
expect(f("hyundax", "hyu") == true and f("hyundax", "x") == false, "wrong result")
end)
Compat.hss.d("hss.string.endswith", function(s, p)
s, p = tostring(s), tostring(p)
return p == "" or s:sub(-#p) == p
end, function(f)
expect(f("hyundax", "dax") == true and f("hyundax", "h") == false, "wrong result")
end)
Compat.hss.d("hss.string.hex", function(s)
return (tostring(s):gsub(".", function(c) return string.format("%02x", c:byte()) end))
end, function(f)
expect(f("Hi") == "4869", "wrong hex")
end)
Compat.hss.d("hss.string.unhex", function(h)
h = tostring(h):gsub("%s", "")
if #h % 2 ~= 0 or h:find("%X") then error("invalid hex", 2) end
return (h:gsub("%x%x", function(x) return string.char(tonumber(x, 16)) end))
end, function(f)
expect(f("4869") == "Hi", "wrong unhex")
end)
Compat.hss.d("hss.string.random", function(n, charset)
n = tonumber(n) or 8
charset = tostring(charset or "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
local t = {}
for i = 1, n do
local k = rng:NextInteger(1, #charset)
t[i] = charset:sub(k, k)
end
return table.concat(t)
end, function(f)
local r = f(16)
expect(#r == 16 and r:match("^%w+$") ~= nil, "wrong random string")
expect(f(8, "a") == "aaaaaaaa", "charset ignored")
end)
Compat.hss.d("hss.string.hash", function(s)
s = tostring(s)
local h = 2166136261
for i = 1, #s do
h = bit32.bxor(h, s:byte(i))
h = ((h % 256) * 16777216 + h * 403) % 4294967296
end
return string.format("%08x", h)
end, function(f)
expect(f("") == "811c9dc5", "wrong hash of empty string")
expect(f("a") == "e40c292c", "wrong hash of 'a'")
end, "FNV-1a 32-bit")
Compat.hss.d("hss.func.memoize", function(fn)
local cache = {}
return function(...)
local key = {}
for i = 1, select("#", ...) do key[i] = tostring((select(i, ...))) end
key = table.concat(key, "\0")
local hit = cache[key]
if not hit then
hit = table.pack(fn(...))
cache[key] = hit
end
return table.unpack(hit, 1, hit.n)
end
end, function(f)
local n = 0
local m = f(function(x) n = n + 1 return x * 2 end)
expect(m(3) == 6 and m(3) == 6, "wrong result")
expect(n == 1, "function ran more than once")
end)
Compat.hss.d("hss.func.once", function(fn)
local done, res = false, nil
return function(...)
if not done then
done = true
res = table.pack(fn(...))
end
return table.unpack(res, 1, res.n)
end
end, function(f)
local n = 0
local o = f(function() n = n + 1 return n end)
expect(o() == 1 and o() == 1 and n == 1, "ran more than once")
end)
Compat.hss.d("hss.func.throttle", function(fn, secs)
secs = tonumber(secs) or 0.1
local last, res = -math.huge, nil
return function(...)
local now = os.clock()
if now - last >= secs then
last = now
res = table.pack(fn(...))
end
if res then return table.unpack(res, 1, res.n) end
end
end, function(f)
local n = 0
local t = f(function() n = n + 1 return n end, 5)
t() t()
expect(n == 1, "throttle let a second call through")
end)
Compat.hss.d("hss.func.pcallx", function(fn, ...)
local r = table.pack(xpcall(fn, function(e)
return { err = e, trace = debug.traceback(tostring(e), 2) }
end, ...))
if r[1] then return true, table.unpack(r, 2, r.n) end
return false, r[2].err, r[2].trace
end, function(f)
local ok, err, trace = f(function() error("boom", 0) end)
expect(ok == false and err == "boom", "error not captured")
expect(type(trace) == "string", "no traceback")
local ok2, v = f(function(x) return x end, 7)
expect(ok2 == true and v == 7, "success path broken")
end)
Compat.hss.d("hss.func.timeit", function(fn, ...)
local t0 = os.clock()
local r = table.pack(fn(...))
return os.clock() - t0, table.unpack(r, 1, r.n)
end, function(f)
local dt, v = f(function() return 5 end)
expect(type(dt) == "number" and dt >= 0, "no elapsed time")
expect(v == 5, "result lost")
end)
Compat.hss.d("hss.func.retry", function(fn, n, delay)
n = tonumber(n) or 3
local last
for i = 1, n do
local r = table.pack(pcall(fn, i))
if r[1] then return true, table.unpack(r, 2, r.n) end
last = r[2]
if i < n and tonumber(delay) and delay > 0 then task.wait(delay) end
end
return false, last
end, function(f)
local calls = 0
local ok, v = f(function()
calls = calls + 1
if calls < 3 then error("fail", 0) end
return "done"
end, 3, 0)
expect(ok == true and v == "done" and calls == 3, "retry logic wrong")
local ok2 = f(function() error("x", 0) end, 2, 0)
expect(ok2 == false, "should report failure")
end)
Compat.hss.d("hss.func.bind", function(fn, ...)
local bound = table.pack(...)
return function(...)
local extra = table.pack(...)
local all = table.clone(bound)
for i = 1, extra.n do all[bound.n + i] = extra[i] end
all.n = bound.n + extra.n
return fn(table.unpack(all, 1, all.n))
end
end, function(f)
local add = f(function(a, b, c) return a + b + c end, 1, 2)
expect(add(3) == 6, "partial application wrong")
end)
Compat.hss.d("hss.func.info", function(fn)
if type(fn) ~= "function" then error("function expected", 2) end
local out = { isLua = false }
local ok, src = pcall(debug.info, fn, "s")
if ok and type(src) == "string" then out.isLua = src ~= "[C]"; out.source = src end
local okn, name = pcall(debug.info, fn, "n")
if okn then out.name = name end
local oka, np, va = pcall(debug.info, fn, "a")
if oka then out.params, out.vararg = np, va end
return out
end, function(f)
local r = f(function(a, b) return a end)
expect(type(r) == "table" and type(r.isLua) == "boolean", "wrong info table")
end)
Compat.hss.d("hss.inst.find", function(root, name, recursive)
return root:FindFirstChild(name, recursive ~= false)
end, function(f)
local a, b, p = Instance.new("Folder"), Instance.new("Folder"), Instance.new("Part")
b.Parent, p.Name, p.Parent = a, "x", b
local deep, shallow = f(a, "x"), f(a, "x", false)
a:Destroy()
expect(deep == p, "recursive search failed")
expect(shallow == nil, "non-recursive search found a descendant")
end)
Compat.hss.d("hss.inst.findAll", function(root, class)
local out = {}
for _, d in ipairs(root:GetDescendants()) do
if d:IsA(class) then out[#out + 1] = d end
end
return out
end, function(f)
local a = Instance.new("Folder")
Instance.new("Part", a)
Instance.new("Part", a)
Instance.new("Folder", a)
local r = f(a, "BasePart")
a:Destroy()
expect(#r == 2, "expected 2 parts, got " .. #r)
end)
Compat.hss.d("hss.inst.path", function(inst)
if typeof(inst) ~= "Instance" then error("Instance expected", 2) end
local names, cur = {}, inst
while cur and cur ~= game do
table.insert(names, 1, cur.Name)
cur = cur.Parent
end
local out = (cur == game) and "game" or "nil"
for _, n in ipairs(names) do
if n:match("^[%a_][%w_]*$") then out = out .. "." .. n
else out = out .. "[\"" .. n .. "\"]" end
end
return out
end, function(f)
local p = Instance.new("Folder")
p.Name = "hx probe"
p.Parent = workspace
local r = f(p)
p:Destroy()
expect(r == "game.Workspace[\"hx probe\"]", "wrong path: " .. tostring(r))
end)
Compat.hss.d("hss.inst.fromPath", function(p)
if type(p) ~= "string" then error("string expected", 2) end
if p:match("^[%a_][%w_]*") ~= "game" then return nil end
local cur, i = game, 5
while i <= #p do
local name, e = p:match("^%.([%a_][%w_]*)()", i)
if not name then name, e = p:match("^%[\"(.-)\"%]()", i) end
if not name then return nil end
cur = cur:FindFirstChild(name)
if not cur then return nil end
i = e
end
return cur
end, function(f)
local p = Instance.new("Folder")
p.Name = "hx probe"
p.Parent = workspace
local r = f("game.Workspace[\"hx probe\"]")
p:Destroy()
expect(r == p, "path not resolved")
expect(f("game.Workspace.hx_does_not_exist") == nil, "missing path should be nil")
end)
Compat.hss.d("hss.inst.waitFor", function(root, name, timeout)
return root:WaitForChild(name, tonumber(timeout) or 5)
end, function(f)
local a, c = Instance.new("Folder"), Instance.new("Part")
c.Name, c.Parent = "child", a
local r = f(a, "child", 1)
a:Destroy()
expect(r == c, "child not returned")
end)
Compat.hss.d("hss.inst.clear", function(root)
local kids = root:GetChildren()
for _, k in ipairs(kids) do k:Destroy() end
return #kids
end, function(f)
local a = Instance.new("Folder")
Instance.new("Part", a)
Instance.new("Part", a)
local n = f(a)
local left = #a:GetChildren()
a:Destroy()
expect(n == 2 and left == 0, "children not cleared")
end)
Compat.hss.d("hss.inst.ancestors", function(inst)
local out, cur = {}, inst.Parent
while cur do
out[#out + 1] = cur
cur = cur.Parent
end
return out
end, function(f)
local a, b = Instance.new("Folder"), Instance.new("Part")
b.Parent = a
local r = f(b)
a:Destroy()
expect(r[1] == a, "wrong parent order")
end)
Compat.hss.d("hss.inst.countDescendants", function(root)
return #root:GetDescendants()
end, function(f)
local a = Instance.new("Folder")
local b = Instance.new("Folder", a)
Instance.new("Part", b)
local n = f(a)
a:Destroy()
expect(n == 2, "expected 2, got " .. n)
end)
Compat.hss.d("hss.version", function()
local n = 0
for _, s in ipairs(specs) do
if s.name:sub(1, 4) == "hss." then n = n + 1 end
end
return "HSS", "1.0", n
end, function(f)
local name, ver, n = f()
expect(name == "HSS" and type(ver) == "string", "wrong identity")
expect(type(n) == "number" and n > 0, "no function count")
end)
Compat.hss.d("hss.store.set", function(k, v)
if k == nil then error("key expected", 2) end
Compat.hss.store[k] = v
end, function(f)
f("hx_t", 5)
expect(Compat.hss.store.hx_t == 5, "value not stored")
Compat.hss.store.hx_t = nil
end, "in-memory store private to HSS")
Compat.hss.d("hss.store.get", function(k)
return Compat.hss.store[k]
end, function(f)
Compat.hss.store.hx_g = "v"
local r = f("hx_g")
Compat.hss.store.hx_g = nil
expect(r == "v" and f("hx_missing") == nil, "wrong value")
end)
Compat.hss.d("hss.store.keys", function()
local out = {}
for k in pairs(Compat.hss.store) do out[#out + 1] = k end
return out
end, function(f)
Compat.hss.store.hx_k = 1
local found = false
for _, k in ipairs(f()) do if k == "hx_k" then found = true end end
Compat.hss.store.hx_k = nil
expect(found, "key not listed")
end)
Compat.hss.d("hss.store.clear", function()
local n = 0
for k in pairs(Compat.hss.store) do
Compat.hss.store[k] = nil
n = n + 1
end
return n
end, function(f)
Compat.hss.store.hx_c = 1
local n = f()
expect(n >= 1 and next(Compat.hss.store) == nil, "store not cleared")
end)
Compat.hss.d("hss.signal.new", function()
local conns = {}
local sig = {}
local function mk(fn, once)
local c = { Connected = true, fn = fn, once = once }
function c:Disconnect() self.Connected = false end
conns[#conns + 1] = c
return c
end
function sig:Connect(fn) return mk(fn, false) end
function sig:Once(fn) return mk(fn, true) end
function sig:Fire(...)
for _, c in ipairs(table.clone(conns)) do
if c.Connected then
if c.once then c.Connected = false end
task.spawn(c.fn, ...)
end
end
local alive = {}
for _, c in ipairs(conns) do
if c.Connected then alive[#alive + 1] = c end
end
conns = alive
end
function sig:DisconnectAll()
for _, c in ipairs(conns) do c.Connected = false end
conns = {}
end
return sig
end, function(f)
local s = f()
local n, once = 0, 0
local c = s:Connect(function(v) n = n + v end)
s:Once(function() once = once + 1 end)
s:Fire(2) s:Fire(3)
expect(n == 5 and once == 1, "signal delivery wrong")
c:Disconnect()
s:Fire(10)
expect(n == 5, "disconnect ignored")
end)
Compat.hss.d("hss.util.uuid", function()
local function hx(n)
local t = {}
for i = 1, n do t[i] = string.format("%x", rng:NextInteger(0, 15)) end
return table.concat(t)
end
return hx(8) .. "-" .. hx(4) .. "-4" .. hx(3) .. "-" .. string.format("%x", rng:NextInteger(8, 11)) .. hx(3) .. "-" .. hx(12)
end, function(f)
local u = f()
expect(u:match("^%x%x%x%x%x%x%x%x%-%x%x%x%x%-4%x%x%x%-[89ab]%x%x%x%-%x+$") ~= nil, "bad uuid: " .. tostring(u))
expect(f() ~= u, "uuids repeat")
end)
Compat.hss.d("hss.math.clamp", function(v, lo, hi) return math.min(math.max(v, lo), hi) end, function(f)
expect(f(5, 0, 3) == 3 and f(-1, 0, 3) == 0 and f(2, 0, 3) == 2, "wrong clamp")
end)
Compat.hss.d("hss.math.lerp", function(a, b, t) return a + (b - a) * t end, function(f)
expect(f(0, 10, 0.5) == 5 and f(2, 4, 0) == 2 and f(2, 4, 1) == 4, "wrong lerp")
end)
Compat.hss.d("hss.math.round", function(n, dec)
local m = 10 ^ (dec or 0)
if n >= 0 then return math.floor(n * m + 0.5) / m end
return math.ceil(n * m - 0.5) / m
end, function(f)
expect(f(3.14159, 2) == 3.14 and f(2.5) == 3 and f(-2.5) == -3, "wrong rounding")
end)
Compat.hss.d("hss.math.sign", function(v) return v > 0 and 1 or (v < 0 and -1 or 0) end, function(f)
expect(f(9) == 1 and f(-3) == -1 and f(0) == 0, "wrong sign")
end)
Compat.hss.d("hss.math.map", function(v, a, b, c, d) return c + (v - a) * (d - c) / (b - a) end, function(f)
expect(f(5, 0, 10, 0, 100) == 50 and f(0, 0, 1, 10, 20) == 10, "wrong map")
end)
Compat.hss.d("hss.math.approx", function(a, b, eps) return math.abs(a - b) <= (eps or 1e-9) end, function(f)
expect(f(0.1 + 0.2, 0.3) == true and f(1, 2) == false, "wrong approx")
end)
Compat.hss.d("hss.math.gcd", function(a, b)
local g, h = math.abs(a), math.abs(b)
while h ~= 0 do g, h = h, g % h end
return g
end, function(f)
expect(f(12, 18) == 6 and f(7, 13) == 1, "wrong gcd")
end)
Compat.hss.d("hss.math.lcm", function(a, b)
local x, y = math.abs(a), math.abs(b)
if x == 0 or y == 0 then return 0 end
local g, h = x, y
while h ~= 0 do g, h = h, g % h end
return x / g * y
end, function(f)
expect(f(4, 6) == 12 and f(0, 5) == 0, "wrong lcm")
end)
Compat.hss.d("hss.math.isPrime", function(n)
if type(n) ~= "number" or n < 2 or n % 1 ~= 0 then return false end
for i = 2, math.floor(math.sqrt(n)) do
if n % i == 0 then return false end
end
return true
end, function(f)
expect(f(2) == true and f(17) == true and f(1) == false and f(9) == false, "wrong prime check")
end)
Compat.hss.d("hss.math.avg", function(t)
if #t == 0 then return 0 end
local s = 0
for _, v in ipairs(t) do s = s + v end
return s / #t
end, function(f)
expect(f({ 1, 2, 3 }) == 2 and f({}) == 0, "wrong average")
end)
Compat.hss.d("hss.array.map", function(t, fn)
local out = {}
for i, v in ipairs(t) do out[i] = fn(v, i) end
return out
end, function(f)
local r = f({ 1, 2, 3 }, function(v) return v * 2 end)
expect(#r == 3 and r[3] == 6, "wrong map")
end)
Compat.hss.d("hss.array.filter", function(t, fn)
local out = {}
for i, v in ipairs(t) do
if fn(v, i) then out[#out + 1] = v end
end
return out
end, function(f)
local r = f({ 1, 2, 3, 4 }, function(v) return v % 2 == 0 end)
expect(#r == 2 and r[1] == 2 and r[2] == 4, "wrong filter")
end)
Compat.hss.d("hss.array.reduce", function(t, fn, init)
local acc = init
for i, v in ipairs(t) do acc = fn(acc, v, i) end
return acc
end, function(f)
expect(f({ 1, 2, 3 }, function(a, v) return a + v end, 10) == 16, "wrong reduce")
end)
Compat.hss.d("hss.array.find", function(t, fn)
for i, v in ipairs(t) do
if fn(v, i) then return v, i end
end
return nil
end, function(f)
local v, i = f({ 5, 8, 12 }, function(x) return x > 6 end)
expect(v == 8 and i == 2, "wrong find")
expect(f({ 1 }, function() return false end) == nil, "should return nil")
end)
Compat.hss.d("hss.array.reverse", function(t)
local out, n = {}, #t
for i = 1, n do out[i] = t[n - i + 1] end
return out
end, function(f)
local r = f({ 1, 2, 3 })
expect(r[1] == 3 and r[3] == 1, "wrong reverse")
end)
Compat.hss.d("hss.array.unique", function(t)
local seen, out = {}, {}
for _, v in ipairs(t) do
if not seen[v] then
seen[v] = true
out[#out + 1] = v
end
end
return out
end, function(f)
local r = f({ 1, 2, 1, 3, 2 })
expect(#r == 3 and r[1] == 1 and r[2] == 2 and r[3] == 3, "wrong unique")
end)
Compat.hss.d("hss.array.flatten", function(t)
local out, seen = {}, {}
local function fl(x)
if seen[x] then return end
seen[x] = true
for _, v in ipairs(x) do
if type(v) == "table" then fl(v) else out[#out + 1] = v end
end
end
fl(t)
return out
end, function(f)
local r = f({ 1, { 2, { 3 } }, 4 })
expect(#r == 4 and r[3] == 3 and r[4] == 4, "wrong flatten")
end)
Compat.hss.d("hss.array.chunk", function(t, n)
n = math.max(1, math.floor(tonumber(n) or 1))
local out = {}
for i = 1, #t do
local g = math.floor((i - 1) / n) + 1
out[g] = out[g] or {}
table.insert(out[g], t[i])
end
return out
end, function(f)
local r = f({ 1, 2, 3, 4, 5 }, 2)
expect(#r == 3 and #r[1] == 2 and #r[3] == 1, "wrong chunks")
end)
Compat.hss.d("hss.array.shuffle", function(t)
local out = table.clone(t)
for i = #out, 2, -1 do
local j = rng:NextInteger(1, i)
out[i], out[j] = out[j], out[i]
end
return out
end, function(f)
local src = { 1, 2, 3, 4, 5, 6 }
local r = f(src)
local sum = 0
for _, v in ipairs(r) do sum = sum + v end
expect(#r == 6 and sum == 21, "elements changed")
expect(src[1] == 1 and src[6] == 6, "original was modified")
end)
Compat.hss.d("hss.array.slice", function(t, i, j)
local n = #t
i, j = i or 1, j or n
if i < 0 then i = n + i + 1 end
if j < 0 then j = n + j + 1 end
i, j = math.max(i, 1), math.min(j, n)
local out = {}
for k = i, j do out[#out + 1] = t[k] end
return out
end, function(f)
local a = f({ 1, 2, 3, 4 }, 2, 3)
expect(#a == 2 and a[1] == 2 and a[2] == 3, "wrong slice")
local b = f({ 1, 2, 3 }, -2)
expect(#b == 2 and b[1] == 2, "wrong negative slice")
end)
Compat.hss.d("hss.string.padleft", function(s, n, ch)
s = tostring(s)
ch = tostring(ch or " "):sub(1, 1)
if ch == "" then ch = " " end
n = tonumber(n) or 0
if #s >= n then return s end
return string.rep(ch, n - #s) .. s
end, function(f)
expect(f("5", 3, "0") == "005" and f("abc", 2) == "abc", "wrong padding")
end)
Compat.hss.d("hss.string.capitalize", function(s)
s = tostring(s)
return s:sub(1, 1):upper() .. s:sub(2):lower()
end, function(f)
expect(f("hELLO") == "Hello" and f("") == "", "wrong capitalize")
end)
Compat.hss.d("hss.string.count", function(s, sub)
s, sub = tostring(s), tostring(sub)
if sub == "" then return 0 end
local n, pos = 0, 1
while true do
local a, b = s:find(sub, pos, true)
if not a then break end
n = n + 1
pos = b + 1
end
return n
end, function(f)
expect(f("aaa", "a") == 3 and f("abab", "ab") == 2 and f("x", "") == 0, "wrong count")
end)
Compat.hss.d("hss.string.replace", function(s, find, rep)
s, find, rep = tostring(s), tostring(find), tostring(rep)
if find == "" then return s end
local out, pos = {}, 1
while true do
local a, b = s:find(find, pos, true)
if not a then
out[#out + 1] = s:sub(pos)
break
end
out[#out + 1] = s:sub(pos, a - 1)
out[#out + 1] = rep
pos = b + 1
end
return table.concat(out)
end, function(f)
expect(f("a.b.c", ".", "-") == "a-b-c", "wrong replace")
end, "plain text, no patterns")
Compat.hss.d("hss.string.reverse", function(s) return tostring(s):reverse() end, function(f)
expect(f("abc") == "cba", "wrong reverse")
end)
Compat.hss.d("hss.string.snake", function(s)
s = tostring(s)
s = s:gsub("(%l)(%u)", "%1_%2")
s = s:gsub("[%s%-]+", "_")
return s:lower()
end, function(f)
expect(f("HelloWorld") == "hello_world", "wrong snake of HelloWorld")
expect(f("my var-name") == "my_var_name", "wrong snake of spaced text")
end)
Compat.hss.d("hss.color.tohex", function(c)
if typeof(c) ~= "Color3" then error("Color3 expected", 2) end
return string.format("%02x%02x%02x", math.floor(c.R * 255 + 0.5), math.floor(c.G * 255 + 0.5), math.floor(c.B * 255 + 0.5))
end, function(f)
expect(f(Color3.fromRGB(255, 0, 128)) == "ff0080", "wrong hex")
end)
Compat.hss.d("hss.color.fromhex", function(h)
h = tostring(h):gsub("^#", "")
if #h ~= 6 or h:find("%X") then error("invalid hex color", 2) end
return Color3.fromRGB(tonumber(h:sub(1, 2), 16), tonumber(h:sub(3, 4), 16), tonumber(h:sub(5, 6), 16))
end, function(f)
local c = f("#ff0080")
expect(typeof(c) == "Color3", "not a Color3")
expect(math.floor(c.R * 255 + 0.5) == 255 and math.floor(c.B * 255 + 0.5) == 128, "wrong channels")
end)
Compat.hss.d("hss.color.lerp", function(a, b, t) return a:Lerp(b, t) end, function(f)
local c = f(Color3.new(0, 0, 0), Color3.new(1, 1, 1), 0.5)
expect(math.abs(c.R - 0.5) < 1e-4 and math.abs(c.G - 0.5) < 1e-4, "wrong blend")
end)
Compat.hss.d("hss.vec.distance", function(a, b) return (a - b).Magnitude end, function(f)
expect(math.abs(f(Vector3.new(0, 0, 0), Vector3.new(3, 4, 0)) - 5) < 1e-4, "wrong distance")
end)
Compat.hss.d("hss.time.now", function() return os.time(), os.clock() end, function(f)
local a, b = f()
expect(type(a) == "number" and a > 0 and type(b) == "number", "wrong time values")
end)
Compat.hss.d("hss.time.format", function(s)
s = math.max(0, math.floor(tonumber(s) or 0))
return string.format("%02d:%02d:%02d", math.floor(s / 3600), math.floor((s % 3600) / 60), s % 60)
end, function(f)
expect(f(3661) == "01:01:01" and f(0) == "00:00:00", "wrong format")
end)
Compat.hss.d("hss.time.parse", function(str)
local total = 0
for p in tostring(str):gmatch("[^:]+") do
local n = tonumber(p)
if not n then error("invalid time", 2) end
total = total * 60 + n
end
return total
end, function(f)
expect(f("01:01:01") == 3661 and f("02:03") == 123 and f("45") == 45, "wrong parse")
end)
Compat.hss.d("hss.time.sleep", function(n)
local t0 = os.clock()
task.wait(tonumber(n) or 0)
return os.clock() - t0
end, function(f)
local dt = f(0.05)
expect(type(dt) == "number" and dt >= 0.04, "did not wait")
end)
Compat.hss.d("hss.player.me", function() return game:GetService("Players").LocalPlayer end, function(f)
local lp = game:GetService("Players").LocalPlayer
if not lp then return skip("no LocalPlayer") end
expect(f() == lp, "not the LocalPlayer")
end)
Compat.hss.d("hss.player.find", function(part)
part = tostring(part):lower()
for _, p in ipairs(game:GetService("Players"):GetPlayers()) do
if p.Name:lower():sub(1, #part) == part or p.DisplayName:lower():sub(1, #part) == part then return p end
end
return nil
end, function(f)
local lp = game:GetService("Players").LocalPlayer
if not lp then return skip("no LocalPlayer") end
expect(f(lp.Name) ~= nil, "player not found")
expect(f("hx_no_such_player_zz") == nil, "should be nil")
end)
Compat.hss.d("hss.player.names", function()
local out = {}
for _, p in ipairs(game:GetService("Players"):GetPlayers()) do out[#out + 1] = p.Name end
return out
end, function(f)
local lp = game:GetService("Players").LocalPlayer
if not lp then return skip("no LocalPlayer") end
local found = false
for _, n in ipairs(f()) do if n == lp.Name then found = true end end
expect(found, "LocalPlayer not listed")
end)
Compat.hss.d("hss.player.character", function()
local lp = game:GetService("Players").LocalPlayer
return lp and lp.Character or nil
end, function(f)
local c = f()
if c == nil then return skip("no character right now") end
expect(typeof(c) == "Instance", "not an Instance")
end)
Compat.hss.d("hss.player.humanoid", function()
local lp = game:GetService("Players").LocalPlayer
local c = lp and lp.Character
return c and c:FindFirstChildOfClass("Humanoid") or nil
end, function(f)
local h = f()
if h == nil then return skip("no humanoid right now") end
expect(h:IsA("Humanoid"), "not a Humanoid")
end)
Compat.hss.d("hss.player.root", function()
local lp = game:GetService("Players").LocalPlayer
local c = lp and lp.Character
return c and c:FindFirstChild("HumanoidRootPart") or nil
end, function(f)
local r = f()
if r == nil then return skip("no root part right now") end
expect(r:IsA("BasePart"), "not a BasePart")
end)
Compat.hss.d("hss.util.typeof", function(v) return typeof(v) end, function(f)
expect(f(Vector3.new()) == "Vector3" and f(1) == "number", "wrong typeof")
end)
Compat.hss.d("hss.util.isCallable", function(v)
if type(v) == "function" then return true end
if type(v) == "table" then
local ok, mt = pcall(getmetatable, v)
return ok and type(mt) == "table" and type(rawget(mt, "__call")) == "function"
end
return false
end, function(f)
expect(f(print) == true and f(1) == false, "wrong function check")
expect(f(setmetatable({}, { __call = function() end })) == true, "callable table not detected")
end)
Compat.hss.d("hss.util.dump", function(v)
local seen = {}
local function d(x)
local tx = type(x)
if tx == "string" then return string.format("%q", x) end
if tx ~= "table" then return tostring(x) end
if seen[x] then return "<cycle>" end
seen[x] = true
local parts, n = {}, #x
for i = 1, n do parts[#parts + 1] = d(x[i]) end
local keys = {}
for k in pairs(x) do
if not (type(k) == "number" and k >= 1 and k <= n and k % 1 == 0) then keys[#keys + 1] = k end
end
table.sort(keys, function(a, b) return tostring(a) < tostring(b) end)
for _, k in ipairs(keys) do
local ks = (type(k) == "string" and k:match("^[%a_][%w_]*$")) and k or ("[" .. d(k) .. "]")
parts[#parts + 1] = ks .. " = " .. d(x[k])
end
seen[x] = nil
return "{" .. table.concat(parts, ", ") .. "}"
end
return d(v)
end, function(f)
expect(f({ 1, "x" }) == '{1, "x"}', "wrong array dump")
expect(f({ a = 1 }) == "{a = 1}", "wrong dictionary dump")
local c = {}
c.self = c
expect(f(c) == "{self = <cycle>}", "cycle not handled")
end)
Compat.hss.d("hss.util.range", function(a, b, step)
step = step or 1
if step == 0 then error("step cannot be zero", 2) end
local out = {}
if step > 0 then
for i = a, b, step do out[#out + 1] = i end
else
for i = a, b, step do out[#out + 1] = i end
end
return out
end, function(f)
local r = f(1, 5)
expect(#r == 5 and r[5] == 5, "wrong ascending range")
local d = f(10, 0, -5)
expect(#d == 3 and d[3] == 0, "wrong descending range")
end)
do
local state = Compat.ext or {}
Compat.ext = state
state.hooks = state.hooks or setmetatable({}, { __mode = "k" })
state.nilSeen = state.nilSeen or setmetatable({}, { __mode = "k" })
state.scriptable = state.scriptable or setmetatable({}, { __mode = "k" })
state.cacheRepl = state.cacheRepl or setmetatable({}, { __mode = "k" })
state.clip = state.clip or ""
state.fps = state.fps or 60
state.warned = state.warned or {}
local function P(name, poly, note)
local s = byName[name]
if not s then return end
s.poly = poly
if note then s.approx = note end
end
local function once(key, msg)
if state.warned[key] then return end
state.warned[key] = true
Log.warn("compat: " .. msg)
end
local function fsx(n) local f = grab(n); return type(f) == "function" and f or nil end
local function fnv(s)
local h = 2166136261
for i = 1, #s do
h = bit32.bxor(h, s:byte(i))
h = (h * 16777619) % 4294967296
end
return string.format("%08x", h)
end
local function hash128(s)
return fnv(s) .. fnv(s .. "#1") .. fnv("#2" .. s) .. fnv(#s .. s)
end
local function isScript(sc)
return typeof(sc) == "Instance" and sc:IsA("LuaSourceContainer")
end
local function srcOf(sc)
local ok, src = pcall(function() return sc.Source end)
if ok and type(src) == "string" and src ~= "" then return src end
return nil
end
P("getgc", function()
return function(includeTables)
local out, seen = {}, {}
local function add(v)
if v ~= nil and not seen[v] then seen[v] = true; out[#out + 1] = v end
end
local function scan(root, depth)
if type(root) ~= "table" then return end
pcall(function()
for _, v in pairs(root) do
local tv = type(v)
if tv == "function" then
add(v)
elseif tv == "table" and not seen[v] then
if includeTables then add(v) end
if depth < 2 then scan(v, depth + 1) end
end
end
end)
end
scan(ENV, 0)
scan(_G, 0)
scan(shared, 0)
for _, lib in ipairs({ string, table, math, os, task, coroutine, bit32, utf8, debug }) do scan(lib, 2) end
return out
end
end, "scans globals and library tables (not the real GC heap)")
local function registry() return { ENV, _G, shared } end
P("getreg", function() return registry end, "emulated registry (globals only)")
P("debug.getregistry", function() return registry end, "emulated registry (globals only)")
P("getsenv", function()
return function(sc)
if not isScript(sc) then error("script expected", 2) end
local env = { script = sc }
if sc:IsA("ModuleScript") then
local ok, res = pcall(require, sc)
if ok and type(res) == "table" then
for k, v in pairs(res) do env[k] = v end
end
end
return setmetatable(env, { __index = ENV })
end
end, "module exports plus globals (cannot read real script locals)")
P("getscriptclosure", function()
return function(sc)
if not isScript(sc) then error("script expected", 2) end
local src = srcOf(sc)
if src and LOADSTRING then
local f = LOADSTRING(src, "=" .. sc:GetFullName())
if f then return f end
end
if sc:IsA("ModuleScript") then
return function() return require(sc) end
end
return function() end
end
end, "compiles Source when readable, otherwise wraps require()")
P("getscriptbytecode", function()
return function(sc)
if not isScript(sc) then error("script expected", 2) end
return srcOf(sc) or ("-- bytecode unavailable (" .. sc.ClassName .. "): " .. sc:GetFullName())
end
end, "returns Source when readable (not real bytecode)")
P("getscripthash", function()
return function(sc)
if not isScript(sc) then error("script expected", 2) end
return hash128(srcOf(sc) or (sc.ClassName .. ":" .. sc:GetFullName()))
end
end, "hash of Source or path")
P("decompile", function()
return function(sc)
if not isScript(sc) then error("script expected", 2) end
return srcOf(sc) or ("-- decompiler unavailable on this executor\n-- " .. sc.ClassName .. ": " .. sc:GetFullName())
end
end, "returns Source when readable (no real decompiler)")
P("getfunctionhash", function()
return function(fn)
if type(fn) ~= "function" then error("function expected", 2) end
local ok, key = pcall(function()
local s, l, n = debug.info(fn, "sln")
return tostring(s) .. ":" .. tostring(l) .. ":" .. tostring(n) .. ":" .. tostring(fn)
end)
return hash128(ok and key or tostring(fn))
end
end, "hash of function identity and debug info")
P("getnilinstances", function()
if not state.nilConn then
pcall(function()
state.nilConn = game.DescendantRemoving:Connect(function(inst) state.nilSeen[inst] = true end)
Compat.conns[#Compat.conns + 1] = state.nilConn
end)
end
return function()
local out = {}
for inst in pairs(state.nilSeen) do
local ok, par = pcall(function() return inst.Parent end)
if ok and par == nil then out[#out + 1] = inst end
end
return out
end
end, "tracks instances removed from the game after Hyundax IUM loaded")
P("getconnections", function()
return function(signal)
if typeof(signal) ~= "RBXScriptSignal" then error("signal expected", 2) end
once("getconnections", "getconnections cannot enumerate engine signals here, returning an empty list")
return {}
end
end, "empty list (engine signals cannot be enumerated)")
P("firesignal", function()
return function(signal, ...)
if typeof(signal) ~= "RBXScriptSignal" then error("signal expected", 2) end
once("firesignal", "firesignal cannot fire engine signals here (no native support)")
end
end, "no-op (engine signals cannot be fired)")
P("isscriptable", function()
return function(inst, prop)
if typeof(inst) ~= "Instance" then error("Instance expected", 2) end
prop = tostring(prop)
local t = state.scriptable[inst]
if t and t[prop] ~= nil then return t[prop] end
return (pcall(function() return inst[prop] end))
end
end, "readability probe plus virtual setscriptable flags")
P("setscriptable", function()
return function(inst, prop, on)
if typeof(inst) ~= "Instance" then error("Instance expected", 2) end
prop = tostring(prop)
local t = state.scriptable[inst]
if not t then t = {}; state.scriptable[inst] = t end
local was = t[prop]
if was == nil then was = (pcall(function() return inst[prop] end)) end
t[prop] = on and true or false
return was
end
end, "virtual flag only (does not unlock engine properties)")
P("fireclickdetector", function()
return function(cd, dist)
if typeof(cd) ~= "Instance" or not cd:IsA("ClickDetector") then error("ClickDetector expected", 2) end
local part = cd.Parent
local cam = workspace.CurrentCamera
local v = vim()
if not (v and cam and part and part:IsA("BasePart")) then error("cannot simulate a click here", 2) end
local pos, vis = cam:WorldToViewportPoint(part.Position)
if not vis then error("ClickDetector part is not on screen", 2) end
local inset = game:GetService("GuiService"):GetGuiInset()
local old = cd.MaxActivationDistance
pcall(function() cd.MaxActivationDistance = math.max(old, tonumber(dist) or 0, 1e4) end)
v:SendMouseMoveEvent(pos.X, pos.Y + inset.Y, game)
v:SendMouseButtonEvent(pos.X, pos.Y + inset.Y, 0, true, game, 1)
v:SendMouseButtonEvent(pos.X, pos.Y + inset.Y, 0, false, game, 1)
task.delay(.3, function() pcall(function() cd.MaxActivationDistance = old end) end)
end
end, "simulates a mouse click on the part (needs it on screen)")
P("fireproximityprompt", function()
return function(pp, amount)
if typeof(pp) ~= "Instance" or not pp:IsA("ProximityPrompt") then error("ProximityPrompt expected", 2) end
task.spawn(function()
local hold, los, en = pp.HoldDuration, pp.RequiresLineOfSight, pp.Enabled
pcall(function() pp.HoldDuration = 0; pp.RequiresLineOfSight = false; pp.Enabled = true end)
for _ = 1, math.max(1, math.floor(tonumber(amount) or 1)) do
pcall(function() pp:InputHoldBegin() end)
task.wait()
pcall(function() pp:InputHoldEnd() end)
task.wait()
end
pcall(function() pp.HoldDuration = hold; pp.RequiresLineOfSight = los; pp.Enabled = en end)
end)
end
end, "uses ProximityPrompt:InputHoldBegin/End")
P("firetouchinterest", function()
return function(a, b, toggle)
if typeof(a) ~= "Instance" or typeof(b) ~= "Instance" or not a:IsA("BasePart") or not b:IsA("BasePart") then
error("BasePart expected", 2)
end
if toggle == 1 or toggle == false then return end
task.spawn(function()
local cf = a.CFrame
pcall(function() a.CFrame = b.CFrame end)
task.wait(.06)
pcall(function() a.CFrame = cf end)
end)
end
end, "briefly moves the first part onto the second")
P("getcallbackvalue", function()
return function(inst, prop)
if typeof(inst) ~= "Instance" then error("Instance expected", 2) end
local ok, v = pcall(function() return inst[prop] end)
if ok and type(v) == "function" then return v end
return nil
end
end, "reads the property (write-only callbacks return nil)")
P("cache.replace", function()
return function(a, b)
if typeof(a) ~= "Instance" or typeof(b) ~= "Instance" then error("Instance expected", 2) end
state.cacheRepl[a] = b
end
end, "records the replacement only")
local function setClip(s) state.clip = tostring(s) end
P("setclipboard", function() return setClip end, "in-memory clipboard")
P("setrbxclipboard", function() return setClip end, "in-memory clipboard")
P("getclipboard", function() return function() return state.clip end end, "in-memory clipboard")
P("getfpscap", function() return function() return state.fps end end, "stored value (engine cap unchanged)")
P("setfpscap", function()
return function(n)
n = tonumber(n)
if not n then error("number expected", 2) end
state.fps = n
end
end, "stored value (engine cap unchanged)")
P("getactors", function()
return function()
local out = {}
for _, i in ipairs(game:GetDescendants()) do
if i:IsA("Actor") then out[#out + 1] = i end
end
return out
end
end, "scans for Actor instances")
P("run_on_actor", function()
return function(actor, code, ...)
if typeof(actor) ~= "Instance" or not actor:IsA("Actor") then error("Actor expected", 2) end
if type(code) ~= "string" then error("string expected", 2) end
if not LOADSTRING then error("loadstring unavailable", 2) end
local f, err = LOADSTRING(code)
if not f then error(err, 2) end
return f(...)
end
end, "runs the code in the current VM, not inside the Actor")
P("getcustomasset", function()
return function(path)
path = tostring(path)
if path:find("^rbxassetid://") or path:find("^rbxasset://") or path:find("^https?://") then return path end
local g = grab("getsynasset")
if type(g) == "function" then return g(path) end
error("getcustomasset is not supported by this executor", 2)
end
end, "passes asset URLs through, falls back to getsynasset")
local QFILE = "HyundaxIUM/queue_on_teleport.lua"
P("queue_on_teleport", function()
return function(code)
if type(code) ~= "string" then error("string expected", 2) end
state.queue = state.queue or {}
state.queue[#state.queue + 1] = code
local w = fsx("writefile")
if w then pcall(w, QFILE, table.concat(state.queue, "\n")) end
end
end, "saved to HyundaxIUM/queue_on_teleport.lua and run next time Hyundax IUM loads (autoexec)")
task.defer(function()
local i, r, d = fsx("isfile"), fsx("readfile"), fsx("delfile")
if not (i and r and d and LOADSTRING) then return end
local ok, src = pcall(function() if i(QFILE) then return r(QFILE) end end)
if ok and type(src) == "string" and src ~= "" then
pcall(d, QFILE)
local f = LOADSTRING(src)
if f then task.spawn(f) end
end
end)
local function xml(s) return (tostring(s):gsub("[&<>\"]", { ["&"] = "&", ["<"] = "<", [">"] = ">", ['"'] = """ })) end
P("saveinstance", function()
return function(a, b)
local opts = type(a) == "table" and a or (type(b) == "table" and b or {})
local root = typeof(a) == "Instance" and a or game
local w = fsx("writefile")
if not w then error("writefile unavailable", 2) end
local out, n = { '<roblox version="4">' }, 0
local function walk(inst)
n = n + 1
if n % 1500 == 0 then task.wait() end
local line = '<Item class="' .. xml(inst.ClassName) .. '"><Properties><string name="Name">' .. xml(inst.Name) .. "</string>"
if inst:IsA("LuaSourceContainer") then
local src = srcOf(inst)
if src then line = line .. '<ProtectedString name="Source"><![CDATA[' .. src:gsub("]]>", "]]]]><![CDATA[>") .. "]]></ProtectedString>" end
end
out[#out + 1] = line .. "</Properties>"
for _, c in ipairs(inst:GetChildren()) do walk(c) end
out[#out + 1] = "</Item>"
end
walk(root)
out[#out + 1] = "</roblox>"
local name = opts.FileName or opts.filename or (tostring(game.PlaceId) .. ".rbxlx")
w(name, table.concat(out, "\n"))
return name
end
end, "hierarchy-only .rbxlx export (names, classes and readable Source)")
local function roots()
local list = { ENV, _G, shared, string, table, math, os, task, coroutine, bit32, utf8, debug }
local nested = {}
for _, r in ipairs({ ENV, _G }) do
pcall(function()
for _, v in pairs(r) do
if type(v) == "table" and v ~= ENV and v ~= _G and v ~= shared then nested[#nested + 1] = v end
end
end)
end
for _, v in ipairs(nested) do list[#list + 1] = v end
return list
end
P("hookfunction", function()
return function(f, new)
if type(f) ~= "function" or type(new) ~= "function" then error("function expected", 2) end
local rec = state.hooks[f]
if rec then
for _, loc in ipairs(rec.locs) do pcall(rawset, loc[1], loc[2], new) end
rec.new = new
return f
end
rec = { new = new, locs = {} }
for _, root in ipairs(roots()) do
pcall(function()
for k, v in pairs(root) do
if rawequal(v, f) then
rec.locs[#rec.locs + 1] = { root, k }
end
end
end)
end
for _, loc in ipairs(rec.locs) do pcall(rawset, loc[1], loc[2], new) end
state.hooks[f] = rec
if #rec.locs == 0 then
once("hookfunction", "hookfunction could only wrap global references (local upvalues cannot be redirected)")
end
return f
end
end, "replaces global/library references (cannot patch local upvalues)")
P("restorefunction", function()
return function(f)
local rec = state.hooks[f]
if not rec then return end
for _, loc in ipairs(rec.locs) do pcall(rawset, loc[1], loc[2], f) end
state.hooks[f] = nil
end
end, "undoes the emulated hookfunction")
P("getnamecallmethod", function() return function() return state.ncm end end, "emulated state")
P("setnamecallmethod", function()
return function(m)
if type(m) ~= "string" then error("string expected", 2) end
state.ncm = m
end
end, "emulated state")
P("setreadonly", function()
return function(t, ro)
if type(t) ~= "table" then error("table expected", 2) end
if ro then
if not table.isfrozen(t) then table.freeze(t) end
elseif table.isfrozen(t) then
once("setreadonly", "setreadonly(false) cannot thaw a frozen table without native support")
end
end
end, "can freeze but cannot thaw frozen tables")
local function noVm(name, ret)
P(name, function()
return function(...)
once(name, name .. " needs native VM access; returning an empty fallback")
return ret
end
end, "stub (needs native VM access)")
end
noVm("debug.getupvalue", nil)
noVm("debug.getupvalues", {})
noVm("debug.setupvalue", nil)
noVm("debug.getconstant", nil)
noVm("debug.getconstants", {})
noVm("debug.setconstant", nil)
noVm("debug.getproto", nil)
noVm("debug.getprotos", {})
noVm("debug.setstack", nil)
P("debug.getstack", function()
return function(level, index)
local out = {}
local ok, s = pcall(debug.info, (tonumber(level) or 1) + 1, "slf")
if index ~= nil then return nil end
if ok then out[1] = s end
return out
end
end, "returns frame info only")
P("debug.getmetatable", function()
return function(obj)
local mt = getmetatable(obj)
if type(mt) == "table" then return mt end
return { __index = function(_, k) return obj[k] end, __metatable = mt }
end
end, "returns a proxy table when the metatable is locked")
P("debug.setmetatable", function()
return function(obj, mt)
if type(obj) == "table" then setmetatable(obj, mt) end
return obj
end
end, "tables only")
P("WebSocket.connect", function()
return function(url)
if type(url) ~= "string" then error("string expected", 2) end
local HS = game:GetService("HttpService")
local ok, client = pcall(function()
return HS:CreateWebStreamClient(Enum.WebStreamClientType.WebSocket, { Url = url })
end)
if not ok or not client then error("WebSocket is not supported by this executor", 2) end
local msgEv, closeEv = Instance.new("BindableEvent"), Instance.new("BindableEvent")
pcall(function() client.MessageReceived:Connect(function(m) msgEv:Fire(m) end) end)
pcall(function() client.Closed:Connect(function() closeEv:Fire() end) end)
return {
OnMessage = msgEv.Event,
OnClose = closeEv.Event,
Send = function(_, data) client:Send(data) end,
Close = function() pcall(function() client:Close() end) end,
}
end
end, "uses HttpService:CreateWebStreamClient when the engine offers it")
end
for _, n in ipairs({ "Drawing.new", "Drawing.Fonts", "cleardrawcache", "isrenderobj", "getrenderproperty",
"setrenderproperty", "crypt.encrypt", "crypt.decrypt", "request", "http_request", "http.request",
"mouse1click", "mouse1press", "mouse1release", "mouse2click", "mouse2press", "mouse2release",
"mousemoveabs", "mousemoverel", "mousescroll", "keypress", "keyrelease", "messagebox", "saveinstance",
"run_on_actor", "WebSocket.connect", "getnamecallmethod", "setnamecallmethod", "debug.setstack",
"cache.replace" }) do
if byName[n] then byName[n].safeNative = true; byName[n].intrusive = (n ~= "saveinstance") end
end
local FS_NAMES = { "writefile", "readfile", "isfile", "delfile", "makefolder", "isfolder", "delfolder",
"listfiles", "appendfile", "loadfile", "dofile" }
Compat.fsBroken = false
function Compat.realNative(name)
local ok, v = pcall(nativeGet, name)
if not ok or type(v) ~= "function" then return nil end
local prev = rawget(ENV, "__hyundaxiumPolys")
if type(prev) == "table" and prev[name] == v then return nil end
return v
end
function Compat.probeFS()
Compat.fsBroken = false
local w, r = Compat.realNative("writefile"), Compat.realNative("readfile")
if not (w and r) then return end
local n = "hxprobe" .. tostring(rng:NextInteger(100000, 999999)) .. ".txt"
local good = false
if pcall(w, n, "probe") then
good = waitFor(function() return r(n) == "probe" end, 1.5)
end
local d = Compat.realNative("delfile")
if d then pcall(d, n) end
if not good then
Compat.fsBroken = true
Log.warn("compat: native filesystem does not persist files — using in-memory fallback for file functions")
end
end
function Compat.scan()
local prev = rawget(ENV, "__hyundaxiumPolys")
for _, s in ipairs(specs) do
local ok, v = pcall(nativeGet, s.name)
if not ok then v = nil end
if v ~= nil and not (s.value or type(v) == "function") then v = nil end
if v ~= nil and type(prev) == "table" and prev[s.name] == v then v = nil end
s.native = v
end
if Compat.fsBroken then
for _, n in ipairs(FS_NAMES) do
if byName[n] then byName[n].native = nil end
end
end
local ci, cv = byName["cache.iscached"], byName["cache.invalidate"]
if ci and cv and (ci.native ~= nil or cv.native ~= nil) then
if Compat.cacheGood == nil then
local good = false
if ci.native ~= nil and cv.native ~= nil then
pcall(function()
local p = Instance.new("Part")
p.Parent = workspace
local a = ci.native(p)
cv.native(p)
local b = ci.native(p)
p:Destroy()
good = (a == true and b == false)
end)
end
Compat.cacheGood = good
if not good then Log.warn("compat: native cache.* is unreliable — using emulated instance cache") end
end
if not Compat.cacheGood then
ci.native, cv.native = nil, nil
ci.force, cv.force = true, true
end
end
end
function Compat.resolve()
table.clear(resolved)
for pass = 1, 2 do
for _, s in ipairs(specs) do
if pass == 1 or (s.fn == nil) then
s.fn, s.src = nil, "missing"
if s.force and s.native ~= nil and s.poly and CONFIG.compat.polyfill then
local okp, fp = pcall(s.poly, R)
if okp and type(fp) == "function" then s.fn, s.src = fp, "poly" end
end
if s.fn ~= nil then
elseif s.native ~= nil then
s.fn, s.src = s.native, "native"
elseif s.poly and CONFIG.compat.polyfill then
local ok, f = pcall(s.poly, R)
if ok and f ~= nil and (s.value or type(f) == "function") then s.fn, s.src = f, "poly" end
end
resolved[s.name] = s.fn
end
end
end
end
function Compat.install(target, own)
own = own or {}
local rec = (target == ENV) and (rawget(ENV, "__hyundaxiumPolys") or {}) or nil
local n = 0
for _, s in ipairs(specs) do
if s.src == "poly" and s.fn ~= nil then
pcall(function()
local parts = splitPath(s.name)
local t = target
for i = 1, #parts - 1 do
local cur = t[parts[i]]
if cur == nil then cur = grab(parts[i]) end
if type(cur) ~= "table" then cur = {} end
if not own[cur] then
cur = table.clone(cur)
own[cur] = true
rawset(t, parts[i], cur)
end
t = cur
end
local last = parts[#parts]
if rawget(t, last) == nil or s.force then
rawset(t, last, s.fn)
n = n + 1
if rec then rec[s.name] = s.fn end
end
end)
end
end
if rec then rawset(ENV, "__hyundaxiumPolys", rec) end
return n
end
function Compat.get(name) return resolved[name] end
local CRASH_FILE = "HyundaxIUM/compat_crash.txt"
local crashed = {}
local function fsFn(n) local f = grab(n); return type(f) == "function" and f or nil end
local function crumbSet(name)
local w = fsFn("writefile")
if not w then return end
local mk, isd = fsFn("makefolder"), fsFn("isfolder")
if mk and isd then pcall(function() if not isd("HyundaxIUM") then mk("HyundaxIUM") end end) end
pcall(w, CRASH_FILE, name)
end
local function crumbClear()
local d, i = fsFn("delfile"), fsFn("isfile")
if d and i then pcall(function() if i(CRASH_FILE) then d(CRASH_FILE) end end) end
end
local function crumbLoad()
local i, r = fsFn("isfile"), fsFn("readfile")
if not (i and r) then return end
local ok, name = pcall(function() if i(CRASH_FILE) then return r(CRASH_FILE) end end)
if ok and type(name) == "string" and name ~= "" then
crashed[name] = true
Log.warn("compat: '" .. name .. "' crashed the client last run and will be skipped")
crumbClear()
end
end
local function runTest(s)
if not s.test then return nil, "no behavior test defined" end
if crashed[s.name] then return false, "skipped: crashed the client in a previous run" end
if s.safeNative and s.src == "native" and not (s.intrusive and CONFIG.compat.intrusive) then
if type(s.fn) == "function" or s.value then return true, "native: existence only (behavior test skipped for safety)" end
return false, "not callable"
end
if s.intrusive and CONFIG.compat.intrusive and s.src == "native" then
local scb = grab("setclipboard")
if type(scb) == "function" then pcall(scb, "hyundaxium-last-intrusive-test: " .. s.name) end
pcall(RAW_PRINT, "[sUNC] intrusive test: " .. s.name)
end
crumbSet(s.name)
local state = { done = false }
local th = task.spawn(function()
local ok, err = pcall(s.test, s.fn)
state.ok, state.err, state.done = ok, err, true
end)
local t0 = os.clock()
while not state.done do
if os.clock() - t0 > 8 then
pcall(task.cancel, th)
crumbClear()
return false, "timeout (8s)"
end
task.wait()
end
crumbClear()
if state.ok then
if type(state.err) == "string" and state.err:sub(1, 5) == "skip:" then return nil, state.err:sub(6) end
return true
end
return false, ((tostring(state.err):gsub("^[^:\n]*:%d+:%s*", "")))
end
function Compat.runOne(name)
local s = byName[name]
if not s then return nil, "unknown function" end
Compat.resolve()
if not s.fn then return "missing" end
local ok, note = runTest(s)
s.note = note
if ok == nil then s.status = "untested"
elseif s.src == "native" then s.status = ok and "pass" or "fail"
else s.status = ok and "poly" or "polyfail" end
return s.status, note
end
function Compat.summaryText()
local st = Compat.stats
if not st then
local nat, pol, mis = 0, 0, 0
for _, s in ipairs(specs) do
if s.src == "native" then nat = nat + 1 elseif s.src == "poly" then pol = pol + 1 else mis = mis + 1 end
end
return string.format("%d functions · %d native · %d polyfilled · %d missing\nNot tested yet — press Test for behavior checks", #specs, nat, pol, mis)
end
local function pct(a, denom) return denom > 0 and math.floor(a / denom * 100 + 0.5) or 0 end
return string.format("sUNC %d%% (%d/%d) · UNC %d%% · behavior %d%% (%d/%d tested)\n%d fail · %d pfail · %d missing · %d untested · %d native · %d poly",
pct(st.passAll, st.total), st.passAll, st.total, pct(st.existAll, st.total),
pct(st.passAll, st.testedAll), st.passAll, st.testedAll,
st.fail, st.polyfail, st.missing, st.untested, st.existNative, st.existAll - st.existNative)
end
function Compat.run()
if Compat.running then return false end
Compat.running = true
Bus.emit("compat:state", true)
crumbLoad()
Compat.probeFS()
Compat.scan()
Compat.resolve()
local st = { total = #specs, existNative = 0, existAll = 0, passNative = 0, passAll = 0, testedNative = 0,
testedAll = 0, untested = 0, fail = 0, polyfail = 0, missing = 0, byCat = {} }
local missingNames = {}
for _, s in ipairs(specs) do
s.status, s.note = nil, nil
local c = st.byCat[s.cat or "?"]
if not c then c = { total = 0, pass = 0 }; st.byCat[s.cat or "?"] = c end
c.total = c.total + 1
if not s.fn then
s.status = "missing"
st.missing = st.missing + 1
missingNames[#missingNames + 1] = s.name
else
st.existAll = st.existAll + 1
if s.src == "native" then st.existNative = st.existNative + 1 end
local ok, note, skipped
if s.test then
ok, note = runTest(s)
skipped = (ok == nil)
end
if not s.test or skipped then
s.status = "untested"
s.note = skipped and ("skipped: " .. tostring(note)) or "exists, but no behavior test is defined"
st.untested = st.untested + 1
else
s.note = note
st.testedAll = st.testedAll + 1
if s.src == "native" then
st.testedNative = st.testedNative + 1
if ok then
s.status = "pass"
st.passNative = st.passNative + 1
st.passAll = st.passAll + 1
c.pass = c.pass + 1
else
s.status = "fail"
st.fail = st.fail + 1
end
else
if ok then
s.status = "poly"
st.passAll = st.passAll + 1
c.pass = c.pass + 1
else
s.status = "polyfail"
st.polyfail = st.polyfail + 1
end
end
end
end
end
Compat.stats = st
Compat.running = false
for line in Compat.summaryText():gmatch("[^\n]+") do Log.info("compat: " .. line) end
local cl = {}
for cat, c in pairs(st.byCat) do cl[#cl + 1] = string.format("%s %d/%d", cat, c.pass, c.total) end
table.sort(cl)
Log.info("compat: " .. table.concat(cl, " · "))
local nf = 0
for _, s in ipairs(specs) do
if s.status == "fail" or s.status == "polyfail" then
nf = nf + 1
Log.error(string.format("compat [%s] %s — %s", s.status == "fail" and "FAIL" or "POLYFAIL", s.name, tostring(s.note)))
end
end
if nf == 0 then Log.ok("compat: no failing tests") end
local ut = {}
for _, sp in ipairs(specs) do
if sp.status == "untested" then ut[#ut + 1] = sp.name .. " (" .. tostring(sp.note) .. ")" end
end
if #ut > 0 then Log.warn("compat untested (" .. #ut .. "): " .. table.concat(ut, "; ")) end
Log.info(string.format("compat FINAL: %d/%d verified by behavior · %d failed · %d untested · %d missing",
st.passAll, st.total, st.fail + st.polyfail, st.untested, st.missing))
if #missingNames > 0 then Log.warn("compat missing (" .. #missingNames .. "): " .. table.concat(missingNames, ", ")) end
Bus.emit("compat:state", false)
return true
end
function Compat.report()
local lines = { BRAND.name .. " " .. BRAND.ver .. " compat report · executor: " .. EXECUTOR_NAME, Compat.summaryText(), "" }
for _, s in ipairs(specs) do
lines[#lines + 1] = string.format("%-8s %-30s %s", string.upper(s.status or s.src), s.name, s.note or s.approx or "")
end
return table.concat(lines, "\n")
end
function Compat.cleanup()
for _, c in ipairs(Compat.conns) do pcall(function() c:Disconnect() end) end
Compat.conns = {}
local f = resolved.cleardrawcache
if f then pcall(f) end
if drawGui then pcall(function() drawGui:Destroy() end) end
end
Compat.scan()
Compat.resolve()
if CONFIG.compat.globalize then Compat.install(ENV, {}) end
end
end
local CppBridge = {}
do
local bridgeEnv = _G
if type(getgenv) == "function" then
local ok, env = pcall(getgenv)
if ok and type(env) == "table" then bridgeEnv = env end
end
local host = nil
local function findHost()
local candidate = rawget(bridgeEnv, "HyundaxIUMCppBridge") or rawget(bridgeEnv, "HyundaxCppBridge")
if type(candidate) ~= "table" then
candidate = rawget(bridgeEnv, "__HYUNDAXIUM_CPP_BRIDGE") or rawget(bridgeEnv, "__HYUNDAX_CPP_BRIDGE")
end
if type(candidate) ~= "table" and bridgeEnv ~= _G then
candidate = rawget(_G, "HyundaxIUMCppBridge") or rawget(_G, "__HYUNDAXIUM_CPP_BRIDGE") or rawget(_G, "HyundaxCppBridge") or rawget(_G, "__HYUNDAX_CPP_BRIDGE")
end
return type(candidate) == "table" and candidate or nil
end
local function invoke(method, ...)
if not host then return false, "C++ bridge unavailable" end
local fn = rawget(host, method)
if type(fn) ~= "function" then return false, "C++ bridge method unavailable: " .. method end
local ok, a, b = pcall(fn, ...)
if not ok then return false, tostring(a) end
return true, a, b
end
function CppBridge.refresh()
host = findHost()
return host ~= nil and type(rawget(host, "ping")) == "function"
end
function CppBridge.isAvailable()
return CppBridge.refresh()
end
function CppBridge.ping()
CppBridge.refresh()
local ok, result = invoke("ping")
if not ok then return false, result end
return true, result == nil and true or result
end
function CppBridge.version()
CppBridge.refresh()
if not host then return nil, "C++ bridge unavailable" end
local value = rawget(host, "version")
if type(value) == "function" then
local ok, result = pcall(value)
if not ok then return nil, tostring(result) end
value = result
end
if type(value) ~= "string" then return "unknown" end
return value:sub(1, 64)
end
function CppBridge.log(level, message)
CppBridge.refresh()
level = tostring(level or "info"):lower()
if level ~= "info" and level ~= "warn" and level ~= "error" then
return false, "invalid log level"
end
message = tostring(message or "")
if #message > 500 then message = message:sub(1, 500) end
return invoke("log", level, message)
end
function CppBridge.call(action, ...)
if action == "ping" then return CppBridge.ping() end
if action == "version" then
local value, err = CppBridge.version()
return value ~= nil, value or err
end
if action == "log" then return CppBridge.log(...) end
return false, "action not allowed"
end
function CppBridge.status()
CppBridge.refresh()
local version = CppBridge.version()
local pingOk, pingResult = CppBridge.ping()
return {
available = pingOk and pingResult ~= false,
ping = pingOk and tostring(pingResult) or tostring(pingResult),
version = version or "unknown",
methods = host and {
ping = type(rawget(host, "ping")) == "function",
version = type(rawget(host, "version")) == "function" or type(rawget(host, "version")) == "string",
log = type(rawget(host, "log")) == "function",
} or { ping = false, version = false, log = false },
}
end
CppBridge.refresh()
end
Compat.cppBridge = CppBridge
pcall(rawset, bridgeEnv, "HyundaxIUMCpp", CppBridge)
pcall(rawset, bridgeEnv, "HyundaxCpp", CppBridge)
local T = {
bg = Color3.fromRGB(10, 10, 10),
side = Color3.fromRGB(10, 10, 10),
panel = Color3.fromRGB(18, 18, 18),
panel2 = Color3.fromRGB(34, 34, 34),
line = Color3.fromRGB(42, 42, 42),
text = Color3.fromRGB(255, 255, 255),
muted = Color3.fromRGB(176, 176, 176),
tan = Color3.fromRGB(66, 140, 255),
gold = Color3.fromRGB(255, 206, 48),
bronze = Color3.fromRGB(230, 40, 50),
bronzeHi = Color3.fromRGB(255, 96, 100),
bronzeLo = Color3.fromRGB(150, 18, 30),
dark = Color3.fromRGB(16, 4, 6),
glow = Color3.fromRGB(52, 12, 16),
cardTop = Color3.fromRGB(26, 26, 26),
}
local function font(weight, family)
local ok, f = pcall(function() return Font.new(family or FONT_FAMILY, weight) end)
if ok and f then return f end
return Font.fromEnum(Enum.Font.GothamBold)
end
local F = {
Regular = font(Enum.FontWeight.Medium),
Medium = font(Enum.FontWeight.SemiBold),
SemiBold = font(Enum.FontWeight.Bold),
Bold = font(Enum.FontWeight.ExtraBold),
}
local MONO = Font.fromEnum(Enum.Font.RobotoMono)
local function safeName(n) return (tostring(n):gsub("[^%w_%-]", "_")) end
local function jsonRead(path, default)
local ok, r = pcall(function()
if isfile and isfile(path) then return HttpService:JSONDecode(readfile(path)) end
end)
if ok and type(r) == "table" then return r end
return default
end
local function jsonWrite(path, data)
return pcall(function() writefile(path, HttpService:JSONEncode(data)) end)
end
T.SETTINGS_FILE = FOLDER .. "/settings.json"
T.UI_THEMES = {
["Hyundax IUM Primary"] = {
bg = Color3.fromRGB(10, 10, 10), side = Color3.fromRGB(10, 10, 10), panel = Color3.fromRGB(18, 18, 18),
panel2 = Color3.fromRGB(34, 34, 34), line = Color3.fromRGB(42, 42, 42), text = Color3.fromRGB(255, 255, 255),
muted = Color3.fromRGB(176, 176, 176), tan = Color3.fromRGB(66, 140, 255), gold = Color3.fromRGB(255, 206, 48),
bronze = Color3.fromRGB(230, 40, 50), bronzeHi = Color3.fromRGB(255, 96, 100), bronzeLo = Color3.fromRGB(150, 18, 30),
dark = Color3.fromRGB(16, 4, 6), glow = Color3.fromRGB(52, 12, 16), cardTop = Color3.fromRGB(26, 26, 26),
},
Darkness = {
bg = Color3.fromRGB(0, 0, 0), side = Color3.fromRGB(1, 1, 1), panel = Color3.fromRGB(5, 5, 5),
panel2 = Color3.fromRGB(10, 10, 10), line = Color3.fromRGB(34, 34, 34), text = Color3.fromRGB(255, 255, 255),
muted = Color3.fromRGB(166, 166, 166), tan = Color3.fromRGB(60, 130, 245), gold = Color3.fromRGB(250, 200, 50),
bronze = Color3.fromRGB(200, 40, 52), bronzeHi = Color3.fromRGB(255, 100, 108), bronzeLo = Color3.fromRGB(120, 18, 30),
dark = Color3.fromRGB(8, 8, 8), glow = Color3.fromRGB(14, 14, 14), cardTop = Color3.fromRGB(2, 2, 2),
},
Lite = {
bg = Color3.fromRGB(255, 255, 255), side = Color3.fromRGB(246, 246, 246), panel = Color3.fromRGB(252, 252, 252),
panel2 = Color3.fromRGB(242, 242, 242), line = Color3.fromRGB(211, 211, 205), text = Color3.fromRGB(28, 28, 26),
muted = Color3.fromRGB(103, 103, 96), tan = Color3.fromRGB(30, 100, 220), gold = Color3.fromRGB(200, 150, 0),
bronze = Color3.fromRGB(176, 36, 48), bronzeHi = Color3.fromRGB(214, 84, 92), bronzeLo = Color3.fromRGB(120, 22, 32),
dark = Color3.fromRGB(28, 18, 19), glow = Color3.fromRGB(246, 226, 226), cardTop = Color3.fromRGB(250, 250, 250),
},
Mint = {
bg = Color3.fromRGB(8, 20, 17), side = Color3.fromRGB(11, 29, 24), panel = Color3.fromRGB(16, 39, 32),
panel2 = Color3.fromRGB(24, 55, 45), line = Color3.fromRGB(43, 82, 67), text = Color3.fromRGB(232, 255, 245),
muted = Color3.fromRGB(158, 190, 174), tan = Color3.fromRGB(96, 196, 150), gold = Color3.fromRGB(168, 240, 120),
bronze = Color3.fromRGB(70, 173, 126), bronzeHi = Color3.fromRGB(122, 222, 177), bronzeLo = Color3.fromRGB(30, 105, 75),
dark = Color3.fromRGB(5, 25, 18), glow = Color3.fromRGB(16, 53, 39), cardTop = Color3.fromRGB(18, 45, 36),
},
Ocean = {
bg = Color3.fromRGB(10, 17, 29), side = Color3.fromRGB(13, 23, 39), panel = Color3.fromRGB(20, 32, 52),
panel2 = Color3.fromRGB(29, 45, 69), line = Color3.fromRGB(49, 69, 98), text = Color3.fromRGB(239, 246, 255),
muted = Color3.fromRGB(164, 181, 204), tan = Color3.fromRGB(108, 168, 220), gold = Color3.fromRGB(120, 210, 255),
bronze = Color3.fromRGB(76, 145, 207), bronzeHi = Color3.fromRGB(142, 196, 240), bronzeLo = Color3.fromRGB(40, 87, 137),
dark = Color3.fromRGB(7, 16, 31), glow = Color3.fromRGB(17, 42, 73), cardTop = Color3.fromRGB(22, 37, 60),
},
}
do
local function RGB(r, g, b) return Color3.fromRGB(r, g, b) end
local function mkTheme(bg, side, panel, panel2, line, text, muted, acc, accHi, accLo, gold, glow, dark)
return {bg = bg, side = side, panel = panel, panel2 = panel2, line = line, text = text, muted = muted, tan = acc, gold = gold,
bronze = acc, bronzeHi = accHi, bronzeLo = accLo, dark = dark or RGB(14, 14, 18), glow = glow, cardTop = panel}
end
T.THEME_ORDER = {"Hyundax IUM Primary", "Darkness", "Lite", "Mint", "Ocean"}
T.THEME_DESC = {}
local function addTheme(name, desc, pal) T.UI_THEMES[name] = pal; T.THEME_DESC[name] = desc; T.THEME_ORDER[#T.THEME_ORDER + 1] = name end
addTheme("Sunset Coral", "Warm coral and peach on deep plum.", mkTheme(RGB(28,16,24), RGB(36,20,30), RGB(46,27,38), RGB(62,37,50), RGB(92,56,72), RGB(255,240,235), RGB(214,176,176), RGB(255,107,107), RGB(255,160,140), RGB(190,62,72), RGB(255,190,120), RGB(70,30,40)))
addTheme("Lavender Dream", "Soft purple and lilac, calm and creative.", mkTheme(RGB(22,18,38), RGB(29,23,50), RGB(39,31,66), RGB(54,44,90), RGB(86,72,130), RGB(244,240,255), RGB(186,176,220), RGB(167,139,250), RGB(201,182,255), RGB(111,78,210), RGB(244,170,255), RGB(52,38,92)))
addTheme("Cherry Blossom", "Light pink pastel with rose accents.", mkTheme(RGB(255,245,248), RGB(252,232,240), RGB(255,255,255), RGB(251,225,236), RGB(240,196,214), RGB(66,28,44), RGB(140,92,112), RGB(224,86,132), RGB(244,140,178), RGB(168,48,92), RGB(240,120,70), RGB(253,220,232), RGB(255,255,255)))
addTheme("Forest Earth", "Moss green and earthy tan, natural.", mkTheme(RGB(20,26,18), RGB(26,34,23), RGB(35,45,31), RGB(48,61,43), RGB(78,96,68), RGB(240,245,230), RGB(172,186,158), RGB(140,176,84), RGB(184,214,130), RGB(88,120,48), RGB(224,184,110), RGB(40,56,32)))
addTheme("Golden Hour", "Amber and honey on warm charcoal.", mkTheme(RGB(26,22,14), RGB(34,28,16), RGB(46,38,22), RGB(62,51,28), RGB(96,80,44), RGB(255,247,226), RGB(202,188,150), RGB(250,176,5), RGB(255,212,92), RGB(190,124,0), RGB(255,140,40), RGB(64,48,14)))
addTheme("Neon Night", "Cyberpunk magenta and electric cyan.", mkTheme(RGB(12,10,24), RGB(18,14,34), RGB(26,20,50), RGB(40,30,76), RGB(70,52,120), RGB(246,240,255), RGB(176,164,210), RGB(255,46,166), RGB(255,120,200), RGB(170,20,110), RGB(0,229,255), RGB(52,18,70)))
addTheme("Arctic Ice", "Crisp white and icy sky blue.", mkTheme(RGB(240,247,252), RGB(228,240,249), RGB(255,255,255), RGB(218,234,246), RGB(180,208,230), RGB(18,38,58), RGB(84,110,134), RGB(36,150,214), RGB(104,190,236), RGB(20,98,156), RGB(0,170,170), RGB(214,236,250), RGB(255,255,255)))
addTheme("Midnight Rose", "Charcoal with dusty rose and mauve.", mkTheme(RGB(22,18,22), RGB(30,24,30), RGB(41,33,41), RGB(56,45,56), RGB(88,72,88), RGB(250,238,244), RGB(190,168,182), RGB(222,126,160), RGB(244,170,196), RGB(160,76,106), RGB(240,190,150), RGB(58,36,50)))
addTheme("Tropical Punch", "Teal, turquoise and pineapple yellow.", mkTheme(RGB(8,28,32), RGB(10,38,44), RGB(14,50,58), RGB(20,68,78), RGB(36,104,114), RGB(236,255,252), RGB(150,200,200), RGB(20,200,190), RGB(110,236,224), RGB(10,128,124), RGB(255,214,10), RGB(10,66,70)))
addTheme("Royal Burgundy", "Deep wine red with champagne gold.", mkTheme(RGB(26,10,16), RGB(36,14,22), RGB(50,20,30), RGB(68,28,42), RGB(104,48,66), RGB(255,238,240), RGB(206,166,174), RGB(200,48,76), RGB(236,100,122), RGB(130,22,44), RGB(232,196,120), RGB(74,22,36)))
local function mkCustom(bg, acc)
local W, B = RGB(255,255,255), RGB(0,0,0)
local lum = bg.R * .299 + bg.G * .587 + bg.B * .114
local alum = acc.R * .299 + acc.G * .587 + acc.B * .114
local p
if lum > .55 then
p = mkTheme(bg, bg:Lerp(B,.05), bg:Lerp(W,.6), bg:Lerp(B,.09), bg:Lerp(B,.2), RGB(24,26,32), bg:Lerp(B,.55), acc, acc:Lerp(W,.3), acc:Lerp(B,.35), acc:Lerp(W,.18), bg:Lerp(acc,.2), nil)
else
p = mkTheme(bg, bg:Lerp(W,.04), bg:Lerp(W,.08), bg:Lerp(W,.14), bg:Lerp(W,.24), bg:Lerp(W,.95), bg:Lerp(W,.7), acc, acc:Lerp(W,.3), acc:Lerp(B,.35), acc:Lerp(W,.18), bg:Lerp(acc,.2), nil)
end
p.dark = (alum > .55) and RGB(14,14,18) or RGB(255,255,255)
return p
end
T.mkCustom = mkCustom
do
local st = jsonRead(T.SETTINGS_FILE, {})
local function rd(t, d) if type(t) == "table" and #t == 3 then return RGB(t[1], t[2], t[3]) end return d end
T.CUSTOM_BG = rd(st.customBg, RGB(24, 20, 40))
T.CUSTOM_ACC = rd(st.customAccent, RGB(230, 50, 60))
addTheme("Custom", "Your own palette: drag the dots to pick colors.", mkCustom(T.CUSTOM_BG, T.CUSTOM_ACC))
end
end
T.ACTIVE_THEME = jsonRead(T.SETTINGS_FILE, {}).theme or "Hyundax IUM Primary"
if not T.UI_THEMES[T.ACTIVE_THEME] then T.ACTIVE_THEME = "Hyundax IUM Primary" end
for k, v in pairs(T.UI_THEMES[T.ACTIVE_THEME]) do T[k] = v end
local Store = {
cloud = jsonRead(PATH.cloud, {}),
saved = jsonRead(PATH.saved, {}),
auto = jsonRead(PATH.autoIdx, {}),
likes = jsonRead(PATH.likes, {}),
}
local FX = {scale = 1.5}
FX.posTweens = setmetatable({}, {__mode = "k"})
function FX.stopMove(o)
local old = FX.posTweens[o]
if old then pcall(function() old:Cancel() end) FX.posTweens[o] = nil end
end
local function tween(o, p, t, style, dir)
local moves = p.Position ~= nil
if moves then FX.stopMove(o) end
local tw = TweenService:Create(o, TweenInfo.new((t or .2) * FX.scale, style or Enum.EasingStyle.Quint, dir or Enum.EasingDirection.Out), p)
tw:Play()
if moves then FX.posTweens[o] = tw end
return tw
end
do
local PROPS = {
Frame = {"BackgroundTransparency"}, ScrollingFrame = {"BackgroundTransparency"},
TextLabel = {"BackgroundTransparency", "TextTransparency"}, TextButton = {"BackgroundTransparency", "TextTransparency"},
TextBox = {"BackgroundTransparency", "TextTransparency"},
ImageLabel = {"BackgroundTransparency", "ImageTransparency"}, ImageButton = {"BackgroundTransparency", "ImageTransparency"},
UIStroke = {"Transparency"},
}
local orig = setmetatable({}, {__mode = "k"})
local function collect(o, list)
for _, c in ipairs(o:GetChildren()) do
if #list >= 260 then return end
if c:IsA("GuiObject") then
if c.Visible then
if PROPS[c.ClassName] then list[#list + 1] = c end
collect(c, list)
end
elseif c:IsA("UIStroke") then
list[#list + 1] = c
end
end
end
function FX.cascade(root, span)
span = span or .45
local list = {}
collect(root, list)
local ry, rh = root.AbsolutePosition.Y, math.max(root.AbsoluteSize.Y, 120)
for _, d in ipairs(list) do
local g = d:IsA("UIStroke") and d.Parent or d
local y = 0
if g and g:IsA("GuiObject") then y = math.clamp((g.AbsolutePosition.Y - ry) / rh, 0, 1) end
local st = orig[d]
if not st then st = {}; orig[d] = st end
local goal, any = {}, false
for _, prop in ipairs(PROPS[d.ClassName]) do
local o = st[prop]
if o == nil then o = d[prop] end
if o < 1 then
st[prop] = o
d[prop] = 1
goal[prop] = o
any = true
end
end
if any then
task.delay(y * span * FX.scale, function()
if not d.Parent then return end
local tw = tween(d, goal, .55)
tw.Completed:Connect(function(state)
if state == Enum.PlaybackState.Completed and orig[d] then
for prop in pairs(goal) do orig[d][prop] = nil end
end
end)
end)
end
end
end
end
local function new(class, props, kids)
local o = Instance.new(class)
local parent
for k, v in pairs(props or {}) do
if k == "Parent" then parent = v
elseif k == "NoI18N" then o:SetAttribute("NoI18N", true)
elseif k == "Glass" then o:SetAttribute("Glass", true)
else o[k] = v end
end
for _, c in ipairs(kids or {}) do c.Parent = o end
o.Parent = parent
if FX.cardSkin and props and props.BackgroundColor3 == T.cardTop and (class == "Frame" or class == "TextButton") then
pcall(FX.cardSkin, o)
end
return o
end
local function round(r) return new("UICorner", {CornerRadius = UDim.new(0, r)}) end
local function stroke(c, t)
return new("UIStroke", {Color = c or T.line, Thickness = t or 1, ApplyStrokeMode = Enum.ApplyStrokeMode.Border})
end
local function pad(l, t, r, b)
t = t or l
return new("UIPadding", {
PaddingLeft = UDim.new(0, l), PaddingTop = UDim.new(0, t),
PaddingRight = UDim.new(0, r or l), PaddingBottom = UDim.new(0, b or t),
})
end
local function vlist(p) return new("UIListLayout", {Padding = UDim.new(0, p or 0), SortOrder = Enum.SortOrder.LayoutOrder}) end
local function hlist(p, va, ha)
return new("UIListLayout", {
FillDirection = Enum.FillDirection.Horizontal, Padding = UDim.new(0, p or 0), SortOrder = Enum.SortOrder.LayoutOrder,
VerticalAlignment = va or Enum.VerticalAlignment.Center, HorizontalAlignment = ha or Enum.HorizontalAlignment.Left,
})
end
local function text(parent, str, size, weight, color, props)
local p = {
BackgroundTransparency = 1, Text = str, TextSize = size,
FontFace = F[weight or "Regular"], TextColor3 = color or T.text,
TextXAlignment = Enum.TextXAlignment.Left,
Size = UDim2.new(1, 0, 0, size + 4), Parent = parent,
}
for k, v in pairs(props or {}) do p[k] = v end
return new("TextLabel", p)
end
local function scroller(parent, props, kids)
local p = {
BackgroundTransparency = 1, BorderSizePixel = 0, ScrollBarThickness = 3,
ScrollBarImageColor3 = T.tan, CanvasSize = UDim2.new(),
AutomaticCanvasSize = Enum.AutomaticSize.Y, Size = UDim2.fromScale(1, 1), Parent = parent,
}
for k, v in pairs(props or {}) do p[k] = v end
return new("ScrollingFrame", p, kids)
end
local function group(parent, props, kids)
local p = {BackgroundTransparency = 1, Size = UDim2.fromScale(1, 1), Visible = false, BorderSizePixel = 0, ClipsDescendants = true, Parent = parent}
for k, v in pairs(props or {}) do p[k] = v end
return new("Frame", p, kids)
end
local function pressFx(b, amount)
local sc = new("UIScale", {Parent = b})
b.MouseButton1Down:Connect(function() tween(sc, {Scale = (amount or .95) - .015}, .1, Enum.EasingStyle.Quad) end)
local function up() tween(sc, {Scale = 1}, .45, Enum.EasingStyle.Back) end
b.MouseButton1Up:Connect(function() FX.sfx.click() end)
b.MouseButton1Up:Connect(up)
b.MouseLeave:Connect(up)
end
local function hoverFx(b, from, to)
local scale = new("UIScale", {Scale = 1, Parent = b})
b.MouseEnter:Connect(function()
if FX.hover ~= false then tween(b, {BackgroundColor3 = to}, .15) end
if FX.lift ~= false then tween(scale, {Scale = 1.025}, .35, Enum.EasingStyle.Back) end
if FX.hoverSnd then FX.sfx.play("bub_hover") end
end)
b.MouseLeave:Connect(function()
tween(b, {BackgroundColor3 = from}, .2)
tween(scale, {Scale = 1}, .3, Enum.EasingStyle.Quint)
end)
end
FX.sfx = {mute = 1, enabled = true, vol = .32, ids = {}, last = {}, any = 0}
do
local Sfx = FX.sfx
pcall(function() Sfx.enabled = jsonRead(T.SETTINGS_FILE, {}).soundFeedback ~= false end)
local SoundService = game:GetService("SoundService")
local SR = 22050
local PRESETS = {
tab = {{720, 1040, .075, .8}},
click = {{540, 430, .04, .55}},
on = {{520, 520, .05, .8}, {780, 780, .09, .8}},
off = {{780, 780, .05, .7}, {480, 480, .09, .7}},
ok = {{660, 660, .06, .8}, {880, 880, .06, .8}, {1175, 1175, .13, .8}},
err = {{210, 150, .18, .9}},
open = {{440, 660, .08, .8}, {660, 990, .14, .8}},
close = {{880, 560, .08, .7}, {560, 380, .12, .7}},
welcome = {{523, 523, .09, .8}, {659, 659, .09, .8}, {784, 784, .09, .8}, {1047, 1047, .26, .85}},
bub_form = {{240, 820, .12, .85, .02}, {820, 640, .07, .5}},
bub_whoosh = {{160, 540, .26, .5, .10}},
bub_pop = {{1500, 420, .045, .9, .35}},
bub_merge = {{980, 300, .12, .85}, {300, 560, .08, .6}},
bub_hover = {{640, 900, .035, .45}},
bub_sel = {{520, 1040, .06, .85}, {1040, 1560, .13, .7}},
bub_land = {{250, 120, .11, .8, .03}},
bub_shine = {{1568, 1568, .05, .5}, {2093, 2093, .05, .45}, {2637, 2637, .16, .4}},
}
for i = 1, 8 do
local f = 360 * 2 ^ ((i - 1) / 6)
PRESETS["bub_p" .. i] = {{f, f * 2.6, .065, .85, .04}, {f * 2.6, f * 2, .035, .4}}
end
local FALLBACK = {
tab = "rbxasset://sounds/switch.wav", click = "rbxasset://sounds/button.wav",
on = "rbxasset://sounds/electronicpingshort.wav", off = "rbxasset://sounds/switch.wav",
ok = "rbxasset://sounds/electronicpingshort.wav", err = "rbxasset://sounds/button.wav",
open = "rbxasset://sounds/electronicpingshort.wav", close = "rbxasset://sounds/switch.wav",
welcome = "rbxasset://sounds/electronicpingshort.wav",
}
local function wav(notes)
local parts, phase = {}, 0
for _, n in ipairs(notes) do
local cnt = math.floor(SR * n[3])
for i = 0, cnt - 1 do
local u = i / cnt
phase = phase + 2 * math.pi * (n[1] + (n[2] - n[1]) * u) / SR
local env = math.min(1, i / (SR * .004)) * (1 - u) ^ 1.8
local v = (math.sin(phase) * .78 + math.sin(phase * 2) * .14 + (n[5] and (math.random() * 2 - 1) * n[5] or 0)) * env * (n[4] or 1)
parts[#parts + 1] = string.pack("<i2", math.floor(v * 28000))
end
end
local data = table.concat(parts)
return "RIFF" .. string.pack("<I4", 36 + #data) .. "WAVEfmt " .. string.pack("<I4I2I2I4I4I2I2", 16, 1, 1, SR, SR * 2, 2, 16)
.. "data" .. string.pack("<I4", #data) .. data
end
local function resolve(name)
local path = FOLDER .. "/sfx2_" .. name .. ".wav"
local ok, asset = pcall(function()
local mk = getcustomasset or getsynasset
if not (writefile and isfile and mk) then error("no fs") end
if not isfile(path) then writefile(path, wav(PRESETS[name])) end
return mk(path)
end)
if ok and asset and asset ~= "" then return asset end
return FALLBACK[name] or "rbxasset://sounds/switch.wav"
end
task.spawn(function()
for name in pairs(PRESETS) do
Sfx.ids[name] = resolve(name)
task.wait()
end
end)
function Sfx.play(name, vol)
if Sfx.mute > 0 or not Sfx.enabled then return end
if Sfx.blurred or (Sfx.off and Sfx.off[name]) then return end
local id = Sfx.ids[name]
if not id then return end
local now = os.clock()
if now - (Sfx.last[name] or 0) < .05 then return end
Sfx.last[name], Sfx.any = now, now
pcall(function()
local s = Instance.new("Sound")
s.SoundId = id
s.Volume = (vol or 1) * Sfx.vol
s.Parent = SoundService
s:Play()
task.delay(2, function() s:Destroy() end)
end)
end
function Sfx.click()
if Sfx.mute > 0 or not Sfx.enabled then return end
local t = os.clock()
task.delay(.07, function() if Sfx.any < t then Sfx.play("click") end end)
end
end
function FX.snd(name) FX.sfx.play(name) end
local function swap(items, target)
if items.cur == target then return end
local prev = items.cur
items.cur = target
items.tok = (items.tok or 0) + 1
local tok = items.tok
local veil = items.veil
if not (veil and veil.Parent) then
veil = new("Frame", {
Name = "Veil", Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 1,
BorderSizePixel = 0, ZIndex = 60, Parent = target.Parent,
})
items.veil = veil
end
if prev then
FX.snd("tab")
tween(prev, {Position = UDim2.fromOffset(0, -14)}, .22, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
tween(veil, {BackgroundTransparency = .1}, .18)
end
task.delay(prev and .2 * FX.scale or 0, function()
if items.tok ~= tok then return end
if items.vis and items.vis ~= target then items.vis.Visible = false end
items.vis = target
target.Position = UDim2.fromOffset(0, 24)
target.Visible = true
FX.cascade(target)
tween(target, {Position = UDim2.fromOffset(0, 0)}, .8, Enum.EasingStyle.Back)
tween(veil, {BackgroundTransparency = 1}, .5)
end)
end
local function arc(cx, cy, r, a1, a2, n)
local p = {}
for i = 0, n do
local a = math.rad(a1 + (a2 - a1) * i / n)
p[#p + 1] = cx + math.cos(a) * r
p[#p + 1] = cy + math.sin(a) * r
end
return p
end
local ICONS = {
home = {{3, 11, 12, 3.5, 21, 11}, {5.5, 9.5, 5.5, 20.5, 18.5, 20.5, 18.5, 9.5}, {10, 20.5, 10, 14.5, 14, 14.5, 14, 20.5}},
code = {{8, 7, 3, 12, 8, 17}, {16, 7, 21, 12, 16, 17}, {14, 5, 10, 19}},
play = {{7, 4.5, 19.5, 12, 7, 19.5, 7, 4.5}},
trash = {{4, 7, 20, 7}, {9, 7, 9, 4, 15, 4, 15, 7}, {6, 7, 7, 20.5, 17, 20.5, 18, 7}, {10.5, 11, 10.5, 16.5}, {13.5, 11, 13.5, 16.5}},
folder = {{3, 6, 9, 6, 11, 8.5, 20.5, 8.5, 20.5, 19.5, 3, 19.5, 3, 6}},
save = {{4, 4, 17, 4, 20, 7, 20, 20, 4, 20, 4, 4}, {8, 4, 8, 9, 15, 9, 15, 4}, {8, 20, 8, 14, 16, 14, 16, 20}},
copy = {{9, 9, 20, 9, 20, 20, 9, 20, 9, 9}, {15, 9, 15, 4, 4, 4, 4, 15, 9, 15}},
bolt = {{13, 3, 5.5, 13, 12, 13, 11, 21, 18.5, 10.5, 12, 10.5, 13, 3}},
plus = {{12, 5, 12, 19}, {5, 12, 19, 12}},
x = {{6, 6, 18, 18}, {18, 6, 6, 18}},
minus = {{5, 12, 19, 12}},
square = {{5, 5, 19, 5, 19, 19, 5, 19, 5, 5}},
restore = {{8, 8, 19, 8, 19, 19, 8, 19, 8, 8}, {5, 16, 5, 5, 16, 5, 16, 8}},
menu = {{4, 7, 20, 7}, {4, 12, 20, 12}, {4, 17, 20, 17}},
search = {arc(10, 10, 6, 0, 360, 14), {14.5, 14.5, 20, 20}},
chevD = {{6, 9, 12, 15, 18, 9}},
cloud = {{7, 18.5, 17, 18.5, 20.5, 15.5, 19, 11.5, 15.5, 10.5, 14, 7, 10, 6.5, 8, 9.5, 5, 11, 3.5, 14.5, 7, 18.5}},
refresh = {arc(12, 12, 7, -30, 240, 14), {19, 3.5, 19, 8.5, 14, 8.5}},
layers = {{12, 3, 21, 8, 12, 13, 3, 8, 12, 3}, {3, 12, 12, 17, 21, 12}, {3, 16, 12, 21, 21, 16}},
user = {arc(12, 8, 4, 0, 360, 12), {4.5, 21, 4.5, 19, 8, 15.5, 16, 15.5, 19.5, 19, 19.5, 21}},
filetext = {{6, 3, 14, 3, 19, 8, 19, 21, 6, 21, 6, 3}, {14, 3, 14, 8, 19, 8}, {9, 13, 16, 13}, {9, 17, 16, 17}},
history = {arc(12, 12, 8.5, 0, 360, 16), {12, 7, 12, 12, 15.5, 14}},
file = {{6, 3, 14, 3, 19, 8, 19, 21, 6, 21, 6, 3}, {14, 3, 14, 8, 19, 8}},
}
local function ell(cx, cy, rx, ry, n)
local p = {}
for i = 0, n do
local a = math.rad(360 * i / n)
p[#p + 1] = cx + math.cos(a) * rx
p[#p + 1] = cy + math.sin(a) * ry
end
return p
end
do
local heart = {}
for i = 0, 28 do
local t = math.rad(360 * i / 28)
local x = 16 * math.sin(t) ^ 3
local y = 13 * math.cos(t) - 5 * math.cos(2 * t) - 2 * math.cos(3 * Loads code from the internet. It downloads more code when it runs (loadstring + HttpGet), which can change after it was posted. From: files.catbox.moe, example.invalid.
Future executor in testing phase, open source.

Universal