Squirrel/Server/Functions/Scripts/LoadScript
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|LoadModule}} This function will load a script folder. Note that the script folder you wish to load should be placed in the ''Scripts/'' folder of your server. =…') |
|||
Line 1: | Line 1: | ||
− | {{Squirrel/Title| | + | {{Squirrel/Title|LoadScript}} |
This function will load a script folder. Note that the script folder you wish to load should be placed in the ''Scripts/'' folder of your server. | This function will load a script folder. Note that the script folder you wish to load should be placed in the ''Scripts/'' folder of your server. | ||
Revision as of 23:29, 24 November 2010
This function will load a script folder. Note that the script folder you wish to load should be placed in the Scripts/ folder of your server.
Syntax
bool LoadScript( string scriptName )
Arguments
- scriptName - The name of the script folder
Example
This example will load the scripts specified in Script.xml in Scripts/SomeScript when the script is loaded.
function onScriptLoad() { LoadScript( "SomeScript" ); print( "SomeScript loaded!" ); return 1; }
Notes
The function print and event onScriptLoad were used in this example. More info about them in the corresponding pages.