Executor
The executor runs JavaScript in your game right away, with nothing to save first. Use it to try an idea, check what an API returns, or run a one-off command. It lives in the in-game menu under Development → Executor.
Run code
- Type or paste code into the editor. Calls to
mpandleetare highlighted, and hovering one shows its help. - Press Execute.
The code runs once, as it is. Print what you want to see with mp.console.logInfo: it appears in the game console. A notification tells you how the run went:
- Script executed: it ran to the end.
- The script has an error and did not start: fix the syntax error and run it again.
- The script stopped with an error: something failed while it ran.
- The script ran too long and was stopped: a script that blocks the game for too long is cut off.
- Another script is still running: wait for it to finish.
- Join a server to run scripts: code runs only on a server.
Scripts have the same objects as everywhere else: mp on every server, api on GTA5RP servers and leet. See the leet API.
// Type code and press Execute.
mp.console.logInfo("Hello from the executor");Save as a script
Save as Script keeps the code in My Scripts on the Scripts tab, where you can run it, edit it or turn on Auto Exec. Give it a name of up to 128 characters. Names must be unique.
Tools
- Wrap Lines wraps long lines for this session.
- Copy Code copies the whole editor.
Code is limited to 100 KB.