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

1 comment
Can anyone help?