Skip to content

Lua Scripts⚓︎

Shared Scripts

Our Discord server allows members to share their Lua scripts.

Copy the LUA file into the scripts folder (more information below). If the script is bundled in a ZIP/RAR package, extract the contents of the package into the scripts folder. If the folder does not exist, create it yourself.

The developer of the script may provide additional steps to import their scripts. Any question regarding a shared script must be asked to its creator.

The Lua engine of 2Take1Menu allows you to expand the functionality of the menu by creating you own features. You can make use of the Lua API to code scripts and run them from within 2Take1, as well as import scripts created by other users.

New releases of 2Take1 often include updates to the API. If you are developing a Lua script, stay tuned to the release notes, as your creation may require a workaround after a new update.

Similarly, if you are using a script created by other user, keep in mind that it might stop working properly after a new release, so ask its creator to update it.

Lua API

Script Installation⚓︎

2Take1 will scan for *.lua and *.luac scripts in the following directory. The scan is not recursive; if the scripts are located in subfolders, they will not be detected:

%appdata%\PopstarDevs\2Take1Menu\scripts\

While 2Take1 is injected, go to Local Tab → Scripts, look for the name of the script and select it to load its features. You may access the features of the script in:

  • Local Tab → Script Features
  • Online Tab → Online Players → *choose a player* → Script Features

Pre-compilation⚓︎

2Take1 supports pre-compiled scripts in *.luac format. By compiling your scripts, you can safely share them with other users without revealing how your features work.

Make sure you strip debug information from your scripts during compilation; otherwise, the debug console could be used to reverse-engineer your script and compromise its secrecy.

You can find more information about luac in their official documentation.

Encryption⚓︎

2Take1's Lua Engine provides the io._encrypt function, which allows you to encrypt your scripts. This prevents other mod menu's Lua loaders from running your scripts, since only 2Take1 will be able to decrypt them.

It is highly recommended that you combine encryption with compilation to further protect your scripts from being tampered with. In order to proceed, you must compile the script first (stripping debug information), and then encrypt the generated luac file. The opposite order would not work, because the compiler is unable to read the encrypted Lua code.

Trusted Mode⚓︎

Some of the functions in the Lua API could be dangerous if used improperly. For this reason, these API features are disabled by default on 2Take1. If you wish to use a script that relies on these functions, you can do so by enabling Trusted Mode.

Trusted mode is split across the following instruction types, which you can enable at Local Tab → Scripts → Trusted Mode:

  • Stats
  • Globals and Locals
  • Natives
  • HTTP requests
  • Memory

Potential danger ahead!

Trusted mode gives scripts access to features that could be risky and get your account banned. Make sure you trust the developer of the script and, if possible, check the source code to verify that there are no unsafe calls.

Using a script in Trusted mode will automatically make you uneligible to provide ban reports or ask for support in our community servers.