natives.requestScript
Function Client Only ![]()
Online and Offline
Available since Client 1.0.0
void natives.requestScript(string scriptName)
The natives.requestScript function is used to Requests a script to be loaded into memory so it can be started later.
Parameters
| 1) | string | scriptName | Name of the script to request. |
Return
| void | This function doesn't return a value. |
Notes
- - Must be called before natives.startNewScript to ensure the script is available- If the script does not exist, the request will silently fail.
Examples
Example 1 - JavaScript:
bindEventHandler("OnResourceReady", thisResource, function() {
// Request the "trafficControl" script
natives.requestScript("trafficControl");
});
Compatibility
There isn't any compatibility information for this function.