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

How to use require? [closed]

Asked by 8 years ago

So I seen where people can use EXAMPLE OF RDS(ROBLOX DEV SERVICES)

require(123)

and it hides there GUI coding, etc.. How do they do that exactly? What does require mean? I want to do the exact same thing but I do not understand this. If you would help me this is for my group just tell me how to use it, etc..

0
I'm currently on my iPad so I can't easily type out a long answer, but the short answer is ModuleScripts. Look them up on the wiki. adark 5487 — 8y
0
require() is a function for Module Scripts, and ROBLOX has provided the functionality to use the require() function on assets on the ROBLOX website. These assets can then make changes to the game (this method is also used in hiding Scripth's admin commands. M39a9am3R 3210 — 8y

Marked as Duplicate by ImageLabel

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?

2 answers

Log in to vote
2
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
8 years ago

Going on to explain my comment,

require() is a function for Module Scripts, and ROBLOX has provided the functionality to use the require() function on assets on the ROBLOX website. These assets can then make changes to the game (this method is also used in hiding Scripth's admin commands.


The require function is used on Module Scripts. They are scripts that run once and that is when they are being called. With ROBLOX they have allowed for you to upload a module script to the site, and be able to run it in game.

Say I had a game setup like this.

  • game
    • Workspace
      • BasePlate
      • Script
        • Source: require(123456789)

Well, in the module script under the asset "123456789", say I had a script that said this:

print('This is a module script running code.')
local module = {}
return module

Well, when the script loads it will run the code in the module script, and functions can be ran through it as well when they are called. Though, that's a completely different question to ask.

Hopefully this answer helped, if it did then remember to upvote and if it solved your problem do not forget to hit that Accept Answer button.
Ad
Log in to vote
1
Answered by 8 years ago
require() 

is used to load Module scripts ID's into game. --Hope this answered your question require() is a specific function

0
I neutralized your answer. Reason being is that you have -11 rep. You can't afford to lose too many more of that. If you want to post a good answer, make sure you know what you're talking about, and go on to explain to others what the solution is. M39a9am3R 3210 — 8y