Skip to content

Code editor

zeljkovranjes edited this page Nov 5, 2026 · 1 revision

The code editor is where you write scripts. The language is on Scripting. This page is about the window.

Open it

  • Effects → Edit as code. With an effect selected, it opens that effect's script. With none selected, you write a new one. This works on presets too.
  • Advanced editor → Effects tab → Code, in the toolbar.
  • Weapon mode → Code for the whole design, or Skin → Write your own for the moving color.
  • Creator → Sticker → Code for the layers, or Printed On → Animate with code for its own script.

The window

The code editor, with each part numbered

  1. The title names the script, with a dot when it has changes that aren't saved. Drag it to move the window. Double-click it to maximize.
  2. The window buttons: Maximize and Close.
  3. The toolbar, below.
  4. The code, with line numbers and VS Code's colors.
  5. The preview, below.
  6. The status bar: where the caret is, the script's size ("3.2 KB of 16 KB"), and how many errors it has. Click the errors to list them. Click a line in the list to jump to it.

Size the window from any edge or corner, down to 380 by 240. Where it was, its theme, Auto-apply and the preview's state are kept on your machine.

The toolbar

Icon Name Key
Disk Save: apply and wear it Ctrl+S
Lightning bolt Auto-apply on or off
Back and forward arrows Undo, redo Ctrl+Z, Ctrl+Y or Ctrl+Shift+Z
Magnifier Find, replace Ctrl+F, Ctrl+H
Numbered list Go to line Ctrl+G
Lines Format: indent and space it one way Shift+Alt+F
Crossed code sign Comment the lines out, or back in Ctrl+/
Note and pencil Keep as draft
Sun or moon Light theme or dark theme
Eye Show or hide the preview
Question mark Reference F1

Other keys:

Key What it does
Ctrl+Space Open completion
Tab, Shift+Tab Indent, outdent
Enter New line, keeping the indent
F3, Shift+F3 Next match, previous match
Esc Close a popup or the find bar

Brackets and quotes close themselves. The bracket or block matching the caret is marked.

Write code

Completion

Suggestions appear as you type: members after a dot, your own names, keys with their pictures, and shapes and stickers with theirs.

Completion listing shapes with their pictures

  1. Each row has a picture, a name and its type.
  2. The line under the list says what the selected one does.

Signature help and hover docs

Inside a call's brackets, the parameter you are on is marked. Rest the mouse on a word for its docs. More… opens it in the reference.

Hover docs on a word

Colors and keys

A small swatch sits before each color in the code. Click it and pick another. Only that value changes, in the same form: hex stays hex. Undo reverts it. A key's picture sits before each key.

A color swatch and its picker

  1. The swatch.
  2. The picker.

Errors

Errors are underlined and counted, and never popped up. They aren't flagged while you are still typing the word. While the code has an error, the last good version keeps showing.

An error underlined, and the error list

  1. The count on the status bar. Click it to show the list.
  2. The list, with each error's line and column. Click one to jump to it.

Find and replace

Ctrl+F finds, with Match case (Aa), Whole word (ab) and a count like "3 of 12". Ctrl+H adds Replace this one and Replace all. Undo reverts a replace all.

The find bar with a count

See what you write

The preview

The eye icon shows what you write beside the code, as you write it. It takes about two fifths of the window. Off, the code takes the whole window.

You are editing The preview shows
An effect or weapon design Your own character, holding the weapon you hold
A weapon skin The weapon alone, close up as you see it in first person
A sticker The sticker flat on its own, turning, its finish shimmering

The preview following the code

The test bar is under it. With a weapon skin, Swing, Shoot, Reload, Take out and Put away play the weapon's own animations, and an action it has no animation for says so.

Auto-apply and Save

  • With Auto-apply on (the default, a bolt icon), the preview follows the code a moment after you stop typing.
  • With it off, nothing changes until Save.
  • Save (Ctrl+S) puts it on the effect and wears it, for everyone, in both modes.

Auto-apply never sends anything to the server as you type.

Code and layers stay in step

With the Advanced editor open, every good build updates its layers and fields. A change there is written into the code in place: the caret stays, and undo works.

  • A field the code works out (a loop, a function, a parameter) can't be changed there. It is put back, with why and its line. Click the line to open the code there.
  • The caret in a layer's lines selects that layer. Selecting a layer puts the caret on its lines.

Close it

Closing it with changes asks: Save, Discard, Keep as draft or Cancel. Keep as draft keeps the text exactly as it is, errors and all, and it comes back from My Effects. Weapon and sticker code has no draft of its own here: save the design or sticker as a draft instead.

Read the reference

The question mark icon, or F1, opens the scripting reference: every name a script can use, with a search, each with a live example. It opens where you left it. See Scripting.

Choose a theme

Dark+ is the default. The sun icon switches to Light+, the moon icon back. Your choice applies to every code editor and the reference.

The dark and light themes

Limits

A script is 16 KB at most, and 32 KB for all the scripts of one look, measured minified. Scripts are stored and shared minified, with comments kept, and opened formatted, in one style for everyone. See Scripting.

Clone this wiki locally