Skip to content

About

Luau global type definitions for writing Roblox exploits, based on sUNC

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Exploit Types

Caution

This project is in an very early state. Most features were not tested properly (for now!). If you find any issues, feel free to report it!

Luau global type definitions for writing Roblox exploits, based on sUNC.

Install (recommended)

Bash (macOS/Linux, Windows via Git Bash or WSL):

curl -fsSL https://raw.githubusercontent.com/jacklebeignet/exploit-types/main/install.sh | bash

PowerShell (native, same flags):

irm https://raw.githubusercontent.com/jacklebeignet/exploit-types/main/install.ps1 | iex

This installs the latest release to ~/.exploit-types/global.d.luau. It's a single copy for all your projects. Nothing else on your system is touched.

Re-run the script anytime to update. Options:

# Pin a version instead of latest
curl -fsSL .../install.sh | bash -s -- --version v1.2.0

# Per-project install (./global.d.luau, no editor config needed)
curl -fsSL .../install.sh | bash -s -- --local

# Custom directory
curl -fsSL .../install.sh | bash -s -- --dir ~/my-types

install.ps1 mirrors these flags (-Version, -Local, -Dir, -DryRun).

Note: collaborators get nothing automatically with the global install! Each machine runs the one-liner once.

Editor setup

The bundle is a Luau definition file: the editor has to load it with luau-lsp, it is not a module you require. Every editor below needs one setting and a restart afterwards.

VS Code

In settings.json (user or workspace):

{ "luau-lsp.types.definitionFiles": ["~/.exploit-types/global.d.luau"] }

~ is expanded by the extension, so the path above works as-is (an absolute path such as /Users/you/.exploit-types/global.d.luau works too). Reload the window afterwards.

Zed

With the Luau extension installed, add the file to the extension's definitions list in settings.json:

{
  "lsp": {
    "luau-lsp": {
      "settings": {
        "definitions": ["/Users/you/.exploit-types/global.d.luau"]
      }
    }
  }
}

Two Zed-specific notes:

  • use an absolute path — the extension does not expand ~, and a relative path is resolved against the project root instead of your home directory;

  • the extension registers the file under the @roblox package name, so keep roblox.enabled at its default false (otherwise the Roblox definitions take that name and yours is dropped). To use a custom name instead, pass the argument yourself:

    {
      "lsp": {
        "luau-lsp": {
          "settings": {
            "roblox": { "enabled": false },
            "binary": {
              "args": ["--definitions:@exploit=/Users/you/.exploit-types/global.d.luau"]
            }
          }
        }
      }
    }

Other editors

Any editor that can start luau-lsp itself can pass the file on the command line — this is what the VS Code and Zed extensions do under the hood:

luau-lsp lsp --definitions:@exploit=/Users/you/.exploit-types/global.d.luau

The @name= prefix is optional, but a unique name is required if you load more than one definitions file.

Layout

  • src/*.d.luau — source of truth, one file per sUNC library (closures, debug, …).
  • global.d.luau — generated single-file bundle (what users download).
  • tests/smoke.luau — compile-time check that every exported global is reachable.
  • build.luau — bundler. After editing src/, run:
lune run build

src/ is definition-file syntax

src/*.d.luau and the generated global.d.luau are Luau definition files — the format editors load through --definitions / luau-lsp.types.definitionFiles. That implies two things:

  • globals are introduced with declare function / declare, because a bare function foo() stays a module local and would never reach the user's global scope;
  • type aliases are written as export type, because an unexported alias is module-local and would not become a global type either.

.d.luau alone is not enough for luau-lsp: it only parses definition syntax for files that are explicitly registered as definitions. .vscode/settings.json and .zed/settings.json therefore list every module as a definition file. When adding a new src/*.d.luau file, add it to both lists too (globs are not supported). Other editors must pass the same files to luau-lsp, for example:

luau-lsp lsp \
  --definitions:@exploit-closures=src/closures.d.luau \
  --definitions:@exploit-debug=src/debug.d.luau
# …one --definitions flag per file

Editors that parse Luau as a regular module (including luau-analyze, which has no definitions-file support) will still report syntax errors on declare: the files are only meant to be read as definition files. To type-check the shipped bundle the way an editor does, use the bundler plus the smoke test:

lune run build
luau-lsp analyze --definitions:@exploit=global.d.luau --platform=standard tests/smoke.luau

.luaurc maps the lune require alias to Lune typedefs at a machine-local path (~/.lune/.typedefs/…). It is editor-only (CI ignores it) — if your editor flags require("@lune/…"), update the path to your own typedefs or delete the file.

Releases

Versions are cut automatically by semantic-release from conventional commits on main (feat: → minor, fix: → patch). Each release attaches the built global.d.luau, which is what install.sh downloads.

About

Luau global type definitions for writing Roblox exploits, based on sUNC

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages