Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

ModuleScript doesn't insert GUI?

This is my main script (located in startergui) :

_M = require(334661744)
_M.test1()

This is my module script :

local _M = {}

function _M.test1()
	script.Folder.MainWallGUI.Adornee = game.Workspace.VritixConsole.MainWall
end

return _M

Fixed the problem before but now there is a new one

The above scripts don't do anything, they don't insert the guis nor do they have any errors in the output..

2 comments

0

So, why are using a number/id for requiring a ModuleScript? I never thought you could..

0

Using require with an ID will load that ID from the catalog as a model and try to require the thing called MainModule in it

1 answer

script in a ModuleScript refers to the module, not the script requiring the module.

You should write your function to be given that sort of information as parameters, instead. e.g.

function _M.test1(folder)
	folder.MainWallGUI.Adornee = ......
_M.test1(script.Folder)

2 comments

0

Alright thank you,and I have another question.. can you get a LocalPlayer from a ModuleScript? If you can't is there any other ways?

0

You can, as long as it was required from a LocalScript.

This discussion is preserved as it was. New answers, comments, and votes are closed.