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

Is Parenting a MainModule Script Loader Possible?

I am making a surfacegui control, and the controls functions are on the script.

However, the module does not want to parent to AvionicFrames

local module = require(3076646088)
module.Parent = script.Parent.Parent.AvionicFrames

the Error occurs on when the Parent is taking place.

4 comments

0

you can get the actual script by replacing the numbers in a link like this: https://www.roblox.com/library/3076646088/Certified-Horizan-Core

0

The numbers are the same though.

0

If the client is running it, they have access to the source as well. As long as you apply a lot of server communication, it should be useless when stolen.

0

And what can i do Instead of using a real script that people can just access it in roblox studio? Because your getting no where closer explaining Why my ModuleScript won't parent.

1 answer

This is because what you receive with require() returns a table to the respectively declared variable, not an actual ModuleScript Instance; therefore cannot be physically moved.

'module' contains all the content that resides within the asset ID provided, simply, if you desire to use these acquired functions within a Script as a Parent of 'AvionicFrames', create a ModuleScript in said placement, or use the line acquiring the content in whichever Script the function are needed.

2 comments

0

Is there another method? Because i would not like to use a physical script to prevent leaks

0

Yes, as I stated, for your situation you'd probably want to use the line acquiring the content: 'local module = require(aassetid)'. This will allow you to have access to the content in an array format, simply write 'module.[function/variable]' and you'll be able to use it; this won't require you to create the physical ModuleScript.

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