|
| 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 |
|
|
|
| 07 Mar 2015 10:11 AM |
| Require will load a ModuleScript. ModuleScripts are pretty much optional, they are just a convenience. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 07 Mar 2015 12:10 PM |
wat
I wanna be a future game dev :3 |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 07 Mar 2015 01:28 PM |
| Why the game give me that error? |
|
|
| Report Abuse |
|
|
|
| 07 Mar 2015 01:30 PM |
| Its just a roblox error, dont worry about it. |
|
|
| Report Abuse |
|
|
|
| 07 Mar 2015 02:59 PM |
| Can someone help me because Isn't working. |
|
|
| Report Abuse |
|
|