AddCoreScript (Method): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>ArceusInator Added an example and some irony |
>ArceusInator No edit summary |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{Locked}}</noinclude> | |||
<onlyinclude>{{Method | <onlyinclude>{{Method | ||
|name = AddCoreScript | |name = AddCoreScript | ||
|arguments = [[Integer]] ''assetId'', [[Instance]] ''parent'' = ''game["Script Context"]'', [[String]] ''name'' | |arguments = [[Integer]] ''assetId''[, [[Instance]] ''parent'' = ''game["Script Context"]''], [[String]] ''name'' | ||
|description = Makes a | |description = Makes a [[CoreScript]] object inside of ''' ''parent'' ''' | ||
|object = ScriptContext | |object = ScriptContext | ||
|protected = Yes | |protected = Yes | ||
}}</onlyinclude> | }}</onlyinclude><noinclude> | ||
{{clear floats}} | {{clear floats}} | ||
{{Example| | {{Example| | ||
If using the [[Command Bar]] or a [[CoreScript]] | If using the [[Command Bar]] or a [[CoreScript]]... | ||
<pre>game[ "Script Context" ]:AddCoreScript( 37801172, game.Players, "StarterScript" ) -- creates the desired CoreScript</pre> | <pre>game[ "Script Context" ]:AddCoreScript( 37801172, game.Players, "StarterScript" ) -- creates the desired CoreScript</pre> | ||
If using a [[Script]] or a [[LocalScript]]... | If using a [[Script]] or a [[LocalScript]]... | ||
<pre>game[ "Script Context" ]:AddCoreScript( 37801172, game.Players, "StarterScript" ) -- s AddCoreScript</pre>}} | <pre>game[ "Script Context" ]:AddCoreScript( 37801172, game.Players, "StarterScript" ) -- s AddCoreScript</pre>}} | ||
[[Category:Methods]]</noinclude> | |||
[[Category:Methods]] |
Latest revision as of 01:44, 30 March 2011
Protected:This item is protected. Attempting to use it in a Script or LocalScript will cause an error.
AddCoreScript( Integer assetId[, Instance parent = game["Script Context"]], String name ) | |
Returns | nil |
Description: | Makes a CoreScript object inside of parent |
Member of: | ScriptContext |
Example
If using the Command Bar or a CoreScript...
game[ "Script Context" ]:AddCoreScript( 37801172, game.Players, "StarterScript" ) -- creates the desired CoreScript
If using a Script or a LocalScript...
game[ "Script Context" ]:AddCoreScript( 37801172, game.Players, "StarterScript" ) -- s AddCoreScript