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

How do you move a ModuleScript called with require() via asset id?

Asked by 7 years ago
Edited 7 years ago

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.

0
You can only require a module script using its id on the server, this will not work with a local script. User#5423 17 — 7y
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. Ali365Dash 0 — 7y
0
The Module needs to be named, "MainScript" to be used like that. EzraNehemiah_TF2 3552 — 7y
0
MainModule*, not MainScript ;3 TheDeadlyPanther 2460 — 7y
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. Ali365Dash 0 — 7y

Answer this question