I'm scripting some security scanners for an airline group, and I'm using require() so that I can update the script without accessing the game and also not have my script stolen and given out as a free model. However, due to there being several scanners, I need the ModuleScript inside the scanner requesting it. This is what I've tried so far: MainModule (ModuleScript):

function move(target)
	script.Parent = target
end
wait(10)
local stuff = script.Parent.Parent.Parent
local gui = stuff.sgui.SurfaceGui
-- Not giving any more of the script because of another reason why I use a loader

Loader Script (server):

local load = require(498500564)
load.move(script.Parent)

Feel free to ask if you need more information on this question. EDIT: No, I'm not trying to find an answer to loading a script from an asset ID. Loading the script works perfectly fine, but I want to move it before any of the code executes.

5 comments

0

You can only require a module script using its id on the server, this will not work with a local script.

0

I'm using a server script. The module script is called properly, but I want to move the module script to a place before the code executes. Everything I try doesn't work.

0

The Module needs to be named, "MainScript" to be used like that.

0

MainModule*, not MainScript ;3

0

I've made my intentions clear in the main post edit, since all of the answers so far haven't helped. Thanks for trying anyway.