|
static script | setReloadOnUpdate (string scriptName, bool reloadOnupdate=true) |
| sets whether or not the script should reload on update. More...
|
|
static script | remove (string scriptName) |
| removes the given script, no longer running it. More...
|
|
static bool | rename (string scriptName, string newName="") |
| renames the script. If no name given, renames the current script. More...
|
|
static script | clear (string scriptName) |
| clears the script, removing all objects associated with it. More...
|
|
static multiReturn< var *... > | triggerFunction (string funcName, string scriptName,...) |
| calls a function in a script. More...
|
|
static string | doString (string scriptStr, string scriptName) |
| does a script string in a script. More...
|
|
static var * | getValue (string variable, string scriptName) |
| gets the value of a variable from another script. More...
|
|
static string | thisName () |
| gets the name of the script where this function is called. More...
|
|
static function | thisFunction () |
| gets the current function where this function is called. More...
|
|
static string | thisFunctionName () |
| gets the name of the function where this function is called. More...
|
|
used to control specific scripts.
static bool script::rename |
( |
string |
scriptName, |
|
|
string |
newName = "" |
|
) |
| |
|
static |
renames the script. If no name given, renames the current script.
Renames the given script, or the current script if no given script.\n
Since loaded scripts must be uniquely named, this is an option for loading multiple instances of a script.\n
NOTE that this is different than renaming the file using server:renameFile().
WARNING: Scripts updated on the server or locally are updated via name. By renaming the script, if a script with that name is downloaded or updated, this script will be replaced.
- Parameters
-
The | name of the script to be renamed (or the new name of the current script if no newName given). |
(optional) | The new name of the script (if not given, scriptName becomes newName). |
- Returns
- Whether or not the rename was successful (e.g. couldn't be renamed because a script with that name already exists).
static script script::setReloadOnUpdate |
( |
string |
scriptName, |
|
|
bool |
reloadOnupdate = true |
|
) |
| |
|
static |
sets whether or not the script should reload on update.
True by default. If this is set to true, a script will call "onCreated()" each time that a script is modified.
Otherwise, if this is false, a script will call "onCreated()" only at the time an app is loaded, and never again.
- Parameters
-
The | name of the script. |
(optional) | Whether or not the script should reload on update. |
- Returns
- Returns itself.
static multiReturn<var* ...> script::triggerFunction |
( |
string |
funcName, |
|
|
string |
scriptName, |
|
|
|
... |
|
) |
| |
|
static |
calls a function in a script.
Given a list of parameters, calls a function and uses them as arguments.\n
Returns only a single variable for each triggered function. If the function doesn't return anything, the variable is nil for the triggered function.\n
WARNING: a script that is being loaded from game:loadScript() will have the function triggered once the script loads. Scripts loaded from a directory, rather than directly loaded, will <b>not</b> be triggered.
- Parameters
-
The | function to trigger in another script. |
The | script name where the function is called. You may use an asterisk (*) as a wildcard to trigger multiple scripts. |
(optional) | The arguments to trigger the function with. |
- Returns
- Returns the first variable from each triggered function's return if any, otherwise nil for that function.