Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ModuleScript doesn't insert GUI?

Asked by 8 years ago

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..

0
So, why are using a number/id for requiring a ModuleScript? I never thought you could.. TheDeadlyPanther 2460 — 8y
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 BlueTaslem 18071 — 8y

1 answer

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
8 years ago

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)
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? UnleashedGamers 257 — 8y
0
You can, as long as it was required from a LocalScript. BlueTaslem 18071 — 8y
Ad

Answer this question