s&box GamePreferences: ConVar-based user settings with attributes
GamePreferences API Reference GamePreferences is a static class for defining user preferences using ConVar attributes with automatic persistence. Type Signature…
Sandbox: BanSystem — persistent ban list with INetworkListener.AcceptConnection
Sandbox BanSystem — Persistent Ban List with INetworkListener is a that implements to intercept incoming connections and reject banned players before they join.…
Project Structure Recommendations
Project Structure Recommendations Community guide for organizing s&box projects based on Facepunch examples and successful community projects. Recommended Folde…
s&box ServerSettings: Server-controlled settings
ServerSettings Static Class ServerSettings is a static class that defines server-controlled settings replicated to all clients. These ConVars control game-wide …
Sandbox: Ownable component — prop protection with IPhysgunEvent and IToolgunEvent
Ownable Component — Prop Protection and Physgun/Toolgun Access Control The component tracks which spawned a . It implements and to enforce ownership checks when…
Ownable Component Pattern for Prop Ownership
Ownable Component - Prop Ownership and Permission System A component that tracks which player spawned an object and enforces ownership-based permissions. Useful…
s&box WeaponConVars: Global weapon settings
WeaponConVars Static Class WeaponConVars is a static class that defines console variables controlling global weapon behavior in s&box. These ConVars can be set …
s&box WheelOverlay: Direction arrow overlay
WheelOverlay Static Class WheelOverlay is an internal static class that draws a spinning direction arrow overlay on wheel faces. Used by the Wheel tool to visua…
s&box NpcConVars: Global NPC AI settings
NpcConVars Static Class NpcConVars is a static class that defines console variables controlling global NPC AI behavior in s&box. These ConVars can be set via co…
Hotloading Pitfalls: Default Values, Types, Delegates, and Optimization
s&box hotloads code changes live when you save or files. Understanding the pitfalls helps avoid subtle bugs during development. How It Works IL Hotload (Fast): …
EnvmapProbe — local reflection captures with Static, Dynamic, and OnDemand modes
EnvmapProbe — Reflection Captures in s&box is a built-in s&box component that captures a cubemap at its world position for local specular reflections. The engin…
CodeGenerator: Compile-Time Method and Property Wrapping via Attributes
The attribute in s&box lets you create custom attributes that wrap methods and properties at compile time. This is the mechanism behind properties and — you can…
s&box player management with RPC, ConCmd, and Connection APIs
s&box Player Management with RPC, ConCmd, and Connection APIs This example shows player kick/ban utilities using s&box's Connection, RPC, ConCmd, and Chat syste…
s&box HUD: UI scale factor
HUD Static Class HUD is an internal static class that provides a scale factor for UI elements based on screen resolution. It ensures UI elements scale proportio…
s&box ServerSettings: Replicated server-controlled settings
ServerSettings API Reference ServerSettings is a static class for server-controlled settings that are replicated to all clients. Type Signature Example Property…
Unit tests in s&box — MSTest setup, engine initialization, and component testing
Unit Tests in s&box s&box supports MSTest-based unit tests. Create a directory in your project folder and restart the editor — a test project is generated autom…
Sandbox: Physgun — grab, freeze, launch, and pull mechanics
Physgun — Grab, Freeze, Launch, and Pull Mechanics The Physgun () is a that lets players grab, move, freeze, and launch physics objects. It uses a struct to tra…
ActionGraph — visual scripting with action nodes, delegates, and C# integration
ActionGraph — Visual Scripting ActionGraph is s&box's visual scripting system. Nodes represent actions or expressions, and links carry values or signals between…
BanSystem Pattern for Player Management
BanSystem - Player Ban Management A GameObjectSystem that manages player bans with persistent storage. Demonstrates , persistence, and RPC commands. Implementat…
s&box DamageTags: Damage type constants
DamageTags Static Class DamageTags is a static class that defines constant string tags used for damage type identification in the s&box damage system. These tag…