Code: Select all
do
local g = {} --put stuff in it
local f = loadstring(--[[stuff]])
setfenv(f, g)
f()
end
Code: Select all
do
local g = {} --put stuff in it
local f = loadstring(--[[stuff]])
setfenv(f, g)
f()
end
just I would usebartbes wrote:Code: Select all
local localvar = {} loadstring("return somefun")(localvar) print(localvar.status)
Code: Select all
assert(loadstring("return somefun"))()(localvar)
Didn't knew it works faster and you said about second method, that it "seems to make more sense", but now I get that it was in answer to kalle2990s way. Indeed, the _G looks cleaner, just it was first time I ever saw that, so maybe that's why I didn't picked it at first...bartbes wrote:Why doesn't _G work, it seems waaaay more appropriate (and it's probably a whole lot faster too)
Users browsing this forum: Majestic-12 [Bot] and 1 guest