So I’m trying to create global variables without using _G. I heard that this would be done using a ModuleScript. Though, how would I create this? I did already brainstorm a bit myself:
The modules are to store whatever you want.
To determine something “global” it would be better to place a module called “Global”.
Personally, I would use it for functions like automatic welds and for information.
Module:
local Global = {
Functions = {
Weld = function()
end
},
Information = {
Apple = 10
},
Colors = {
Red = Color3.fromRGB(255,0,0)
}
}
return Global
It is not necessary to create a function in the module to request a direct data from the table.
If you want to modify it, you must do it from the server if the module is for clients and server.
If it is only for the client, it will not be necessary for the server to modify it.