natives.startNewScript
Jump to navigation
Jump to search
Function Client Only ![]()
Online and Offline
Available since Client 1.0.0
void natives.startNewScript(string scriptName, int stackSize)
The natives.startNewScript function is used to Starts a new script that has been requested and loaded.
Parameters
| 1) | string | scriptName | Name of the script to start. |
| 2) | int | stackSize | Size of the stack memory to allocate (default ~1024). |
Return
| void | This function doesn't return a value. |
Notes
- - Must be called after natives.requestScript and natives.hasScriptLoaded return true- The stack size defines how much memory the script can use; larger scripts may require bigger values.
Examples
Example 1 - JavaScript:
bindEventHandler("OnResourceReady", thisResource, function() {
// Start the "trafficControl" script with a stack size of 2048
natives.startNewScript("trafficControl", 2048);
});
Compatibility
There isn't any compatibility information for this function.