i made an import function on roblox which sets a variable in an environment but currently you have to pass getfenv() through the function for it to work, which kind of ruins the thing i was going for. what are other things i could try?
A ModuleScript will do!
Script:
1 | require(workspace.ModuleScript)() |
ModuleScript:
1 | return function () |
2 | local env = getfenv ( 2 ) -- Script |
3 | env [ 'message' ] = "Hello There!" |
4 | setfenv ( 2 ,env) |
5 | end ) |