Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it possible to retrieve the raw metatable of a locked metatable?

Asked by
ked2000 15
10 years ago

[PLUGIN] I'm trying to get the metatable of a script's function environment, but I haven't found a perfect way yet. cntkillme was of great help to me but I need to be able to get the metatable of the function environment to have access to the user-defined values.

This is what I have so far:

local function getSenv(arg)
    local func = setfenv(loadstring(arg.Source), setmetatable({arg}, {__index = getfenv(0);}));
    local argEnv = getfenv(func);

    return argEnv;
end

Answer this question