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 Repository⚓︎

Popstar DEVs provide a repository where script developers from the community may upload their scripts, allowing for other users to search and download them easily.

If you are a script developer and want your script added to the repo, contact staff in our community servers.

Manual 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\

Running Scripts⚓︎

While 2Take1 is injected, go to Local Tab → Scripts → (script name) → Run. You may access the features of the script in:

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

You can also unload individual scripts at any time, or stop them all at once.

autoexec.lua⚓︎

2Take1 allows you to load a script automatically when the menu is injected. To do so, name your script autoexec.lua and place it with the rest in the scripts directory.

Aside from this auto-loading behavior, it's just a script like any other. You may want to use the code in this script to load other scripts, for example.

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 individually for each script you have installed:

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

There's also a separate configuration for Trusted flags, destined to Lua code executed from the console.

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.

Script Integrity⚓︎

As a script developer, you may want to prevent other users from tampering with your work. There are two main ways to achieve it, and they work best when combined:

Pre-compilation⚓︎

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

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 also create an encrypted autoexec.luac.

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.

You can also encrypt a pre-compiled script to guarantee its integrity. You must first compile it and then encrypt the luac; the opposite order would not work because the compiler is unable to read encrypted Lua code.