✓ Accepted answer
Module scripts are a little odd at first, but you were almost there.
Example of module script function:
module = { }
function module.doThis()
end
return module
How to call the function in another script:
module = require([Path to Module Script])
module.doThis()
Using your information:
local module = {}
function module.GUI(Arguments)
local GUI = script.ScreenGui
GUI:Clone().Parent = game.StarterGui
end
return module
From here, you would need to direct a path to the module script when you call it using require.
It should look something like this...
require(game.ServerScriptService.ModuleScript)
Above is not what you need to put to get this working, this is just an example of what you need to do to get it working.
Let me know if you have any other questions.
Note: I think the error you provided is for something else entirely.
2 comments
That warning shouldn't be related to this code..
This is my first time making module script