natives.startNewScript

From GTA Connected
Revision as of 16:42, 28 November 2025 by 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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Client Only icon-iv.png 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

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.