natives.startNewScript: Difference between revisions
Jump to navigation
Jump to search
ChrisGame20 (talk | contribs) (Created page with "{{ScriptItem |endpoint = client |games = iv |type = function |name = natives.startNewScript |parameters = string scriptName, int stackSize |parameter1 = string scriptName Name of the script to start |parameter2 = int stackSize Size of the stack memory to allocate (default ~1024) |usage = Starts a new script that has been requested and loaded |notes = - Must be called after natives.requestScript and natives.hasScriptLoaded return true - The stack size defines how...") |
(No difference)
|
Latest revision as of 16:42, 28 November 2025
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.