Squirrel/Server/Functions/Scripts/LoadScript

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(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|LoadModule}}
+
{{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

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

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

  1. 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.

  1.  
  2. function onScriptLoad()
  3. {
  4. LoadScript( "SomeScript" );
  5. print( "SomeScript loaded!" );
  6. return 1;
  7. }
  8.  

Notes

The function print and event onScriptLoad were used in this example. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox