LoadScript

From Liberty Unleashed Wiki
Jump to: navigation, search
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 someone types /load.

  1.  
  2. function onPlayerCommand( id, cmd, text )
  3. {
  4. if ( cmd == "load" )
  5. {
  6. LoadScript( "SomeScript" );
  7. Message( "SomeScript loaded!" );
  8. }
  9. return 1;
  10. }
  11.  

Notes

The function Message and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox