Bornescript language reference
Bornescript is the scripting language of the Borne Engine. It reads scripts written for older GS2 servers and keeps their behavior, with the documented differences, and it adds a few extensions. This reference is for people who write scripts: weapons, NPCs, classes, and level code.
You can try most of the examples in the playground on the documentation site without a server.
- Source files: the
.bscextension, and the server and client halves. - Lexical structure: comments, names, keywords, numbers, strings, and operators.
- Values and conversions: kinds of value, number and string conversion, and lists in strings.
- Variables and scopes: prefixes, name lookup, dynamic names, and
player. - Operators: precedence, arithmetic, comparison, truthiness, and
in. - Functions: declaring, calling, visibility, and anonymous functions.
- Statements: control flow,
switch,enum,const,with, andtry. - Reuse: classes,
join, andimport. - Arrays: literals, indexing, and copy rules.
- Errors: compile errors, run-time errors, and limits.
- Coroutines and timers:
sleep,waitfor,async, timers, and scheduled events. - Objects, flags, and events: kinds of script object, flags, and the events the engine raises.
- Compatibility quirks: the quirks that stay, and the compiler modes.
- Differences from legacy GS2
- Warnings and errors: every code, with the fix.
- Type annotations
- Authoring conventions
Also: the open questions that are provisional, and the API reference.
How to read the notes
Section titled “How to read the notes”- Extension means the engine adds it on purpose. Older scripts do not use it.
- Provisional means the engine had to choose and the older behavior is not confirmed. The page names the open question, for example OQ-LANG-3, and the open questions page lists what the engine does until it is settled. Do not depend on a provisional behavior without a test of your own.
- Examples marked with
// expect:lines are run by the project’s tests, so they print what the page says.
Engine version 0.1.0. Built 2026-11-18.