I have a table which should've been used for saving the game, but I recently found out that to save it it needs to be in normal Script. Is there any way to transfer content from one script to another WITHOUT using global variables?
COMMUNITY QUESTION
How to transfer stuff from LocalScript to Script?
1 answer
You can use ModuleScripts. They are generally scripts that do not run unless you call them from the LocalScript or ServerScript by calling the global function 'require'.
The localscript or serverscript:
local printModule = require(game.ServerScriptService.ModuleScript)
printModule("Test Print") -- prints "Test Print" to output
The modulescript:
function printThis(value)
print(value)
end
return printThis
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Slight problem, you can't acces it from client.