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:
require(workspace.ModuleScript)()
ModuleScript:
return function() local env = getfenv(2) -- Script env['message'] = "Hello There!" setfenv(2,env) end)