Hello! I’m currently trying to make a plugin that helps with R64 modding, and I’m trying to make a script running in playtest mode send a table to my plugin so that it can access data such as variables, tables and functions.
I tried using _G and a module script, which both failed due to weird plugin stuff. What I did for _G is set a value to it to be set as the table, but it wouldn’t load in my plugin. And what I did with the module is just change the module’s returning table to be the table the script would give to the table.
I still haven’t tested it with shared, but I’ll do so when I get home.
Thank you for reading and trying to help!
-SkyFear
Plugin scripts run in their own environment, so you can’t get any table values that have been changed from the game’s runtime environment since they are two different tables. This is why _G fails to share values to your plugin script and why modules would give you the same return value as if the module was required for the first time; editing this table during runtime will just result in table updates in that respective environment.
I am not completely sure if this will work, but maybe try using bindable events to pass your values to the plugin script. I know this works when transmitting data between actor environments with parallel luau, and I think it could be able to cross the barrier between your game runtime and plugin environments.
This did work to pass values between my script and plugin, but functions however don’t work. They are passable, but not runnable.
So what I’m gonna do is fire an event from my plugin to a moduleScript to run specific stuff, thanks for the help!