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

How can I get a script's function environment without having it calling a function?

Asked by
ked2000 15
9 years ago

I am creating a plugin and I have access to a script's Source but I don't have any method to retrieve it's function environment. How can I get a script's function environment externally?(If I can't, is there something alternative?)

ROBLOX Script

--[[
!plugin

#include a
--]]

.lua

local function include(doc, args, line)
    if (#args == 1) then
        if (C.Documents[args[1]]) then
            local target = C.Documents[args[1]]; 
            --Just think of target as a script object
            --How can I get the script env?
        else
            out(doc, line, 3, "Document '"..args[1].."' does not exist in storage!")
        end
    else
        out(doc, line, 3, "Invalid number of arguments.");
    end
end
0
Can anyone help? ked2000 15 — 9y

Answer this question