Scooby Docs

TF2 & TF2 CLASSIFIED

Build your next Lua tool.

Start with a small overlay, add custom controls, or explore the copied game data. Both editions share the core tf2 API. Classified also supports the tf2c alias and its labeled edition-specific entries.

Host API 1.0 Shared UI API 1.1

EXAMPLE 01 RETAIL + CLASSIFIED

Player HUD

Show your class, health and movement speed when a local player snapshot is available.

Download Lua ↓

EXAMPLE 02 RETAIL + CLASSIFIED

Player labels

A toggleable overlay of recognized players with distance filtering and screen projection.

Download Lua ↓

EXAMPLE 03 RETAIL + CLASSIFIED

Edition and capabilities

Print the game, API version, four-team support and session availability in the console.

Download Lua ↓

Run your first script

  1. Open the in-game Lua / Scripts manager or Lua Editor.
  2. Use its folder control to locate your editable scripts, then add a downloaded .lua example.
  3. Refresh the list, select the file and choose Run. Bundled examples do not run automatically.
  4. Use Stop for that script before editing or reloading it. Open the console for the error line and callback name if it fails.

The HUD and player labels draw only when an eligible local session supplies live data. Edition Info also works without a live player.

Write for both editions

CheckRetail TF2TF2 Classified
tf2.info().game_idtf2tf2_classified
Lua globaltf2tf2 and tf2c
Edition capabilitiesMvM, viewmodel offsetsFour teams, Civilian

Read tf2.capabilities() and check individual settings with tf2.has_feature(id). Capabilities describe implemented interfaces, not complete gameplay acceptance.

Check the running edition
assert(TF2_API_VERSION == "1.0", "Update the TF2 Lua host")
local info = tf2.info()
local caps = tf2.capabilities()
print(info.game, info.game_id, info.api_version)
print("Four teams:", caps.four_teams, "Civilian:", caps.civilian)
print("Game data available:", tf2.session().data_available)

Work with snapshots

Check tf2.session().data_available, handle nil and reacquire player/entity tables inside each callback. Map changes, disconnects, an ineligible session or Stop can make game queries empty. Returned tables are copies; editing one does not write game memory.

Stopping a script removes its callbacks and UI. Changes made to built-in settings remain and can be saved in a profile. Raw native hook APIs are not provided by the TF2 extension.

Download the complete host contract, Classified contract or shared UI reference for behavior and limits.