This is the least amount of code I could get it to work with
Code: Select all
local test = {};
function test:new ()
return {};
end
function test:print ()
end
local p,s = pcall(load("return _ENV;", nil, "t", { test:new(), test }));
local path = string.match(serpent.line(s), ".-/(.-)|.*")
game.player.print(path);
When it prints out the result of that it gives a string pointing to the path of the mod:
Now, im not sure how "bad" this is or if something else is going on here. I mean its not a major issue, just something that might want to be looked into. I found this whilst debugging a mod which runs lua scripts in computers in game so would be thankful if you didn't just remove pcall or load and could find a different way of sorting this out (if it needs to be).
Thanks!