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

How can I use require() to load in my model?

Hello. I have an anti-exploit server protection gui (This is not a single script! It consists of GUIs AND scripts!)

I was wondering how I could make it into a 'loader':

-- Here you would add some instructions, for example turn HttpEnabled on...
-- Then it would say this:
require(AssetId)
-- And then maybe something else to do with the MainModule.

I am aware of the MainModule, but how do I use it? Thanks for your help.

1 answer

✓ Accepted answer

To answer your question you would first have to create a module then place your items such as guis inside it in folders (not required but is neater) then name the module MainModule so you can require it your module will look like this.

local module = {}
-- You will place your code between these such as

gui = script.Guis.YourGui:Clone()
gui.Parent = game.Players.Player1

-- as u can see you would need a folder called Guis then the gui named YourGui inside the module
return module

as to require it all you have to do is require the asset id and your done

1 comment

0

Thank you for your answer.

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