So I've heard some people talk about actually CREATING a custom loadstring function to load code locally (typically in script builder). Is this even possible? How would you be able to make your own loadstring function?
-- I know this could be totally wrong, but this is the only thing i could come close to -- even though it's probably way off. local http = game:GetService("HttpService") local source = http:GetAsync("URL") local function parse_string(str) local c = '' for i in str:gmatch(".")do c = c..'\\'..i:byte() end return c end local function load(str) local l = '' for i in str:gmatch('[^\\]+')do if tonumber(i) and string.char(tonumber(i)) then l = l..string.char(tonumber(i)) end end return l end loadstring(load(parse_string(source)))()
Don't laugh, but that's about as close to anything that i'm going to get regarding making a custom loadstring function. If somebody could help, or offer just the slightest of advice, i would very much appreciate it.
And as always, thank you for your time.
Yes there is a way. What you need is a Lua bytecode interpreter, LBI for short. There should be a few online examples for you to edit. Although, if you want to make a Script Builder, you may need to create a custom error handler, as the ones provided on many open source interpreters are fairly uninformative. Let me know how you get on! :D