generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Require

Previous Thread :: Next Thread 
felipeblox10 is not online. felipeblox10
Joined: 09 Oct 2009
Total Posts: 276
07 Mar 2015 10:02 AM
What does require do?
and How I can "require" a script from my models so when the game runs the script insert into the place
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
07 Mar 2015 10:11 AM
Require will load a ModuleScript. ModuleScripts are pretty much optional, they are just a convenience.
Report Abuse
felipeblox10 is not online. felipeblox10
Joined: 09 Oct 2009
Total Posts: 276
07 Mar 2015 11:31 AM
oh and There is a way so when the game runs a script from my models inserts?
Report Abuse
felipeblox10 is not online. felipeblox10
Joined: 09 Oct 2009
Total Posts: 276
07 Mar 2015 12:08 PM
?
Report Abuse
UnlimitedKoradoxic is not online. UnlimitedKoradoxic
Joined: 14 Jul 2011
Total Posts: 452
07 Mar 2015 12:10 PM
wat

I wanna be a future game dev :3
Report Abuse
Froast is not online. Froast
Joined: 12 Mar 2009
Total Posts: 3134
07 Mar 2015 12:11 PM
You can require ModuleScripts.
These can technically be used for running regular scripts but are made for holding items as a module.
Requiring it returns whatever is specified in the module (usually a table) that can then be used.

In order to require a module from an asset it must be named "MainModule", and then you require the assetId.
Report Abuse
felipeblox10 is not online. felipeblox10
Joined: 09 Oct 2009
Total Posts: 276
07 Mar 2015 12:59 PM
The game gives me this error:
15:58:58.131 - Content failed for http://www.roblox.com/Asset/?id=180416148&serverplaceid=223703666&clientinsert=0 because HTTP 403 (Asset is not trusted for this place)
15:58:58.131 - Content failed because HTTP 403 (Asset is not trusted for this place)
Report Abuse
Skyman772 is not online. Skyman772
Joined: 20 Mar 2012
Total Posts: 9305
07 Mar 2015 01:01 PM
Require takes the information that's returned from the ModuleScript.

So, if in a modulescript that's the child of a script you had

return "Hello world!"

In the script, you'd be able to do

print(require(script:WaitForChild("ModuleScript"))) > "Hello world!"
Report Abuse
felipeblox10 is not online. felipeblox10
Joined: 09 Oct 2009
Total Posts: 276
07 Mar 2015 01:28 PM
Why the game give me that error?
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
07 Mar 2015 01:30 PM
Its just a roblox error, dont worry about it.
Report Abuse
felipeblox10 is not online. felipeblox10
Joined: 09 Oct 2009
Total Posts: 276
07 Mar 2015 02:59 PM
Can someone help me because Isn't working.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image