Tutorial / Tools > World
Logic: the complete guide
Triggers and logic for RP and PVP: buttons, switches, plates, trigger boxes, timers, counters, gates... wired to doors, messages, sounds, teleports, spawners and each other.
Getting started
Logic is built with one tool: Q menu > KGX's Admin Toolbox > World > Logic. You place nodes (buttons, trigger boxes, timers, counters and so on), then give each node outputs: "When this happens, do that". Everything is saved per map in data/kgx_admin_toolbox/logic_<map>.json and comes back after a restart. This guide covers v3.6.21.6.1, which adds event nodes and actions for every part of the toolbox: the economy, the police and the Mayor, staff, day and night, progression, the phone and more.
Tool controls
| Key | What it does |
|---|---|
| Left-click | Places the node picked in Node to place and opens its editor. A trigger box or invisible wall needs two clicks, one for each opposite corner. In Paste mode, left-click pastes instead. |
| Right-click | Opens the editor of the node you aim at. |
| E + right-click | Copies the aimed node. Switch to Paste mode and left-click to place copies. |
| Shift + E + right-click | Adds the aimed node to a group copy, or takes it out. |
| Reload (R) | Removes the aimed node. |
| E + reload | Cancels a first box corner you already clicked. |
While the tool is out, every node is drawn with lines to whatever its outputs drive. The HUD shows what you are placing ("Placing: Trigger box").
The tool panel
- Mode: Place a new node, or Paste (the copied node, or the preset picked further down).
- Node to place: every node kind, with its help text shown under the list.
- Trigger box / wall height: if both corners you click are on the floor, the box is made this tall (16–4096; players' own boxes up to 2048).
- New buttons / switches / plates: silent, Confirmation on and Their sound: the defaults for new bodies. Each node's own editor can change them later.
- Show nodes and fires without the tool (debug): see Debugging, further down.
- Nodes on this map: a list of every node. Double-click to edit. Right-click to go to the node, copy it, save it as a preset or delete it. Ctrl or Shift + click selects several nodes.
- Presets: saved node templates you can paste anywhere.
Where nodes go
| Placement | Nodes | How |
|---|---|---|
| On a surface (a body you can see) | Button, Switch, Button (multiple), Pressure plate | Stuck to the wall or floor you aim at, facing out. A plate lies flat and faces you. |
| A box (two corners) | Trigger box, Invisible wall | Click two opposite corners. |
| A marker | Everything else (timers, counters, relays, gates, pages, delays…) | A small marker 12 units off the surface you aim at. Players don't see markers; only the tool and debug view draw them. |
| An entity | Entity watcher | Aim at the entity to watch: a map button or door, a toolbox button, keypad or teleporter, a talking NPC or a prop. |
A Zone watcher must be placed inside a World > Zones zone, and only admins can place one.
The node editor
The editor opens when you place a node, or when you right-click one. From top to bottom it has:
- The node's help, and its Name (shown in lists and pickers).
- Runs: off means the node is disabled until something sends it an Enable input.
- The node's settings. Hover any field for a tooltip.
- Body position and angle (buttons, switches, Button (multiple)): six sliders that move and turn the body live, plus Reset position, Flip and Turn 90 degrees. The new position is kept only when you click Save.
- Now: the node's live state, such as enabled or disabled, on or off, a counter's value, a timer running, or how many things are inside.
- The output list, with the columns When · Do · Target · Delay · Once. Double-click a row to edit it.
- Buttons: Add output, Edit, Duplicate output, Remove, a list of events and Test, Copy node, Save as preset…, Save and Delete node.
Test fires the chosen event right away, with you as the activator. It only runs outputs that are already saved, so click Save first. Nothing is stored until you click Save; closing the window throws the changes away.
Limits
- Up to 400 nodes per map, and up to 32 outputs per node.
- Each node gets an id: L1, L2, L3… Other nodes, conditions and talking NPCs use that id to point at it.
- Players can't physgun node bodies. Only the Logic, Inspect and Remover tools work on them. A body removed some other way comes back in 2 seconds.
How logic works
Every piece of logic follows one sentence: when an event happens on a node, do an action, after a delay, if the conditions hold. A node sending an input to another node is just one of those actions, so you can chain nodes as far as you like.
Each output takes this path on its own. When the action sends an input to another node, that node's event starts the path again, one step deeper.
The parts
- Node: a thing on the map with a kind (Button, Timer, Counter…), its settings and up to 32 outputs.
- Event ("When"): something that happened to the node, such as OnPressed, OnEnter, OnTimer or OnHitMax. Each kind has its own list (see Node reference). Every kind also has OnEnabled, OnDisabled, OnVoteWin and OnVoteLose.
- Output: one line in the editor: When, Do, Target, the action's fields, Delay, Only once and Only if. A node can have several outputs for the same event, and they all run.
- Action ("Do"): what happens: open a door, show a message, teleport, send an input to another node, start a vote, and so on (see Actions).
- Input: a command one node sends to another with the action Logic node: send an input (Press, Trigger, Add, SetA, Start, Open…). Some inputs take a value: Add 5, SetA on, Value 3.
- Activator: whoever set the chain off. It is passed down the chain and kept through delays, so "the activator" in an action five nodes later is still the person who pressed the first button.
{name}in texts becomes the activator's name, or "someone" when there is none.
Who the activator is
| Source | Activator |
|---|---|
| Button, switch, Button (multiple), page buttons | The player who pressed |
| Trigger box, sphere, plate, zone watcher | The one who came in or left. For OnOccupied it's the first one in; for OnEmpty, the last one out. |
| Entity watcher | Who used, damaged, broke, talked to it or got teleported |
| Timer, Clock, Map start | Nobody |
| Delay, Countdown | Whoever started it |
| Server events | Whoever joined, left, spawned, died or chatted. For OnPlayerKill and OnNPCKilled, the killer. |
| Vote results (OnVoteWin / OnVoteLose) | Whoever set off the output that started the vote |
| Test button | You |
Enabled and disabled
Most nodes take Enable and Disable inputs. Timer, Counter and Logic gate don't list them in the input picker: stop a timer with Stop, or untick Runs in the editor. A disabled node ignores every other input and fires nothing on its own. A disabled trigger also forgets who was inside.
Trigger boxes, spheres, relays and walls also take Toggle, which switches between enabled and disabled. For a switch, a branch or a timer, Toggle works on the node's own state instead.
Disabling a running Delay or Countdown cancels it, and it fires OnCanceled.
Delay, Only once and Random
- Delay (0–3600 s): the action runs that many seconds later. If you edit and save the node before the delay ends, the waiting action is dropped.
- Only once: the output runs the first time only, until the map restarts. Saving the node resets it.
- A Random node runs one of the outputs that match its event, picked at random. Every other node runs all of them.
Safety limits
- Chain depth: a chain stops after 24 steps (node → node → node…), so two nodes triggering each other can't freeze the server. The count goes on through delays and through the events an action sets off (an action that wants someone, which fires OnWanted again; one that sets the time or noclip, which fires OnNight or OnNoclipOn again…), so a loop with a delay in it stops too. For something that should repeat forever, use a Timer node: each tick starts a fresh chain.
- Rate: at most
kgxat_logic_rateactions per second on the whole server (default 400, range 50–5000). Above that, the rest are skipped and the server log says "a loop?". - Master switch:
kgxat_logic 0stops all logic from running. The nodes stay saved. - Map cleanup: a cleanup resets every node's live state: switches go back to their start, counters to their start value, timers to their "Runs from the start" setting. Map start nodes then fire OnCleanup. Variables are not reset by a cleanup.
Node reference
There are 26 node kinds in six groups. Every kind also fires OnEnabled, OnDisabled, OnVoteWin and OnVoteLose (see Votes), and every kind has a Name and a Runs box. The tables below leave those out.
Things players use
| Node | What it does | Inputs | Events (When) | Settings |
|---|---|---|---|---|
| Button | Pressed with E. | Press, Enable, Disable | OnPressed; OnLocked (pressed while disabled); OnTooSoon (pressed during its cooldown) | Cooldown 0–60 s (default 1, never below 0.2); Text on it; Look (11 models, plus Custom model and Invisible for admins); Custom model path; HUD prompt, second line and color; Silent; Press sound; Confirmation and its question; body position |
| Switch | Flipped on or off with E. | TurnOn, TurnOff, Toggle, Enable, Disable | OnOn, OnOff, OnToggled (either way), OnLocked, OnTooSoon | Starts on; Cooldown (default 0.5); Text; Look (lever, slider, cage light, power switch, custom, invisible); HUD prompt; Silent; Flip sound; Confirmation; body position |
| Button (multiple) | E opens a window with a title, text and up to 8 buttons. Each button fires its own event. | Open (opens for the activator), Enable, Disable | OnOpened, OnOption1–8, OnAnyOption, OnClosed, OnLocked, OnTooSoon | Cooldown; Text on it; Window title; Text in the window (up to 1000 characters); Button 1–8 labels (empty = no button); Each button asks "Are you sure?"; The window closes after a button; Window color; Look; HUD prompt; Silent; sound; body position |
| Pressure plate | Pressed while something stands on it. | Enable, Disable | OnPressed (the first one steps on), OnReleased (the last one steps off), OnPlayerEnter | Pressed by: Players, NPCs, Players and NPCs, Props, or Anything; Silent; Step sound |
- OnLocked and OnTooSoon fire at most once a second per player, so mashing E doesn't spam.
- Confirmation shows an "Are you sure?" box (or your own question). The button fires only on Yes, and only if the player is still alive and within 200 units.
- Invisible buttons draw nothing for players, but E and the HUD prompt still work. It's good for "press E on the painting".
- HUD prompt: the text players see when they look at the body, such as "Elevator" / "Press E to call".
- Sounds: a game sound (
buttons/button9.wav,.mp3or.ogg) or a sound script (Weapon_Pistol.Single). Empty means the normal click. Links are not allowed here.
Areas
| Node | What it does | Inputs | Events (When) | Settings |
|---|---|---|---|---|
| Trigger box | An invisible box (two corners). Checked 5 times a second. | Enable, Disable, Toggle | OnEnter, OnExit (each one), OnOccupied (first in), OnEmpty (last out), OnPlayerEnter, OnNPCEnter, OnPropEnter, OnPlayerExit | Reacts to (Players, NPCs, both, Props, Anything); Only (team, job, rank or NPC tag, comma separated; empty = everyone) |
| Trigger sphere | An invisible ball around the marker. | Enable, Disable, Toggle | Same as the trigger box | Radius 16–4000 (default 128); Reacts to; Only |
| Zone watcher | Watches the World > Zones zone it was placed in (players only). Admins only. | ZoneOn, ZoneOff, ZoneToggle (turn that zone's effect on or off), Enable, Disable | OnEnter, OnExit, OnOccupied, OnEmpty, OnPlayerEnter, OnPlayerExit | Only (team, job or rank) |
| Invisible wall | A solid invisible box: nothing walks, drives or shoots through it while it's on. | Enable (on), Disable (off), Toggle | OnTurnedOn, OnTurnedOff | Starts on; Players see a faint outline |
Watchers
| Node | What it does | Inputs | Events (When) | Settings |
|---|---|---|---|---|
| Entity watcher | Watches the entity you aimed at. Players may only watch their own things. | Enable, Disable | OnUsed (E), OnButton (a toolbox button pressed), OnCodeRight / OnCodeWrong (keypad), OnTeleported (teleporter), OnDamaged, OnBroken, OnTalk (talking NPC) | Cooldown 0–60 s for OnUsed and OnDamaged (default 0.5) |
| Server events (admins) | Players and NPCs anywhere on the server. | Enable, Disable | OnPlayerJoin, OnPlayerLeave, OnPlayerSpawn, OnPlayerDeath (activator: who died), OnPlayerKill (the killer), OnPlayerHurt, OnNPCKilled (the killer), OnChatWord, OnJobChanged | Chat word for OnChatWord (empty = any message); Hide that chat message; Only (team, job or rank) |
| Match watcher | Game Modes matches. | Enable, Disable | OnLobby, OnPrep, OnRoundStart, OnRoundEnd, OnMatchStart, OnMatchEnd, OnPlayerOut, OnPointCaptured, OnFlagCaptured, OnBombPlanted, OnBombDefused, OnBombExploded, OnEscortArrived, OnBodyFound, OnWaveStart, OnWaveCleared (Waves, v3.6.21.6.1) | Only this mode (mode id; empty = any; the built-in waves mode is survival). Activator: the player who did it, or the round's best player |
| Economy events (admins, v3.6.21.6.1) | Money anywhere on the server. | Enable, Disable | OnPaycheck, OnStoreBought, OnStoreSold, OnPropertyBought, OnPropertySold, OnTreasuryIn, OnTreasuryOut, OnRobberyStarted, OnRobbed, OnPrinterHacked, OnMoneyAlert | Only amounts of at least (the paycheck, price, robbery or treasury amount; 0 = any); Only (team, job or rank). Activator: the player (none for the treasury) |
| Police & Mayor events (admins, v3.6.21.6.1) | The law. | Enable, Disable | OnWanted, OnWantedCleared, OnWarrant, OnWarrantLifted, OnJailed, OnUnjailed, OnCuffed, OnUncuffed, OnLockpicked, OnDoorBreached, OnLockdownStart, OnLockdownEnd, OnLawsChanged | Only (team, job or rank). Activator: the player it happened to (the lock picker for OnLockpicked; nobody for a door blown open or the laws) |
| Staff events (admins, v3.6.21.6.1) | Moderation. | Enable, Disable | OnReport, OnWarned, OnAntiCheat, OnRevived, OnRulesAccepted, OnBanned, OnAdminAction | Only admin actions with the word (OnAdminAction: e.g. kicked, jailed, money); Only (team, job or rank). Activator: the player; for OnBanned and OnAdminAction the admin (staff only: police and Mayor lines in the Action Log do not count) |
| Day, night & weather events (admins, v3.6.21.6.1) | The toolbox's day and night (Utilities > Day/Night & Weather, while it is on). | Enable, Disable | OnHour, OnTimeOfDay, OnDawn (5:00), OnDay (8:00), OnDusk (17:00), OnNight (20:00), OnWeatherChanged | Hour for OnTimeOfDay (0–23); OnWeatherChanged only for (a weather, or any). No activator |
| Progression & server events (admins, v3.6.21.6.1) | Players and the server. | Enable, Disable | OnLevelUp, OnAchievement, OnSeasonEnded, OnVoteStarted, OnVoteEnded (activator: who started the vote), OnServerModeChanged, OnBuff (a buff, food or drug), OnVoiceLine | Only (team, job or rank) |
| Phone & player activity events (admins, v3.6.21.6.1) | What players do. | Enable, Disable | OnCall (the caller), OnText (the sender; not what was written), OnPropSpawned, OnVehicleEnter, OnVehicleExit, OnNoclipOn, OnNoclipOff (checked twice a second; not while dead or in a vehicle) | Only (team, job or rank) |
| Map start | Runs once when the logic is up. | Enable, Disable | OnMapStart (3 s after the map loads), OnCleanup (2 s after a map cleanup) | None |
| Clock (real time) (admins) | The server's own clock. | FireNow, Enable, Disable | OnTime | When: Every day at the time, Every hour at the minute, or Every N minutes; Hour; Minute; Every N minutes (1–1440) |
- An entity watcher on something that isn't permanent (not a map entity, perma prop or saved toolbox entity) works until that entity is removed or the map restarts.
- OnPlayerHurt fires at most once a second per player.
- OnChatWord matches the word anywhere in the message, ignoring case. Hide only works when a word is set, and never hides commands (
/,!,@). Gagged players' messages don't count. - The v3.6.21.6.1 event nodes hear the whole server, so only admins place them. An output that sets off its own event (OnWanted → make the activator wanted) stops after 4 rounds.
- Day, night & weather is checked every second and only while the toolbox's day / night is on. Setting the time with a node fires OnHour for the new hour, and the phase event of the part of the day it lands in (a jump from 3:00 to 12:00 fires OnDay).
- Clock uses the server's local time. It is checked every 10 seconds and fires once per due minute. "Every N minutes" counts from midnight, so 30 fires at :00 and :30.
Timing
| Node | What it does | Inputs | Events (When) | Settings |
|---|---|---|---|---|
| Timer | Fires over and over while running. | Start, Stop, Toggle, FireNow, Enable, Disable | OnTimer, OnStarted, OnStopped, OnFinished (after its last time) | Every 0.5–3600 s (default 10); Plus up to N s at random; Runs from the start; Stop after this many (0 = never) |
| Delay | Waits, then fires OnDone with the same activator. | Start, Cancel, Restart, Enable, Disable | OnStarted, OnDone, OnCanceled | Delay 0.1–3600 s (default 5); Start while running starts over (off = a second Start is ignored) |
| Cooldown (debounce) | Lets Trigger through at most once per cooldown. | Trigger, Reset, Enable, Disable | OnPass, OnBlocked (too soon) | Cooldown 0.1–3600 s (default 5); Per: Everyone (one cooldown) or Each player |
| Countdown (on screen) | Shows a countdown on screens, then fires OnFinished. | Start, Cancel, Enable, Disable | OnStarted, OnFinished, OnCanceled | Seconds 1–3600 (default 10); Text ({time} = the time left, default "Starting in {time}"); Shown to (audience); Color |
- Restart on a Delay always starts it over, whatever the setting.
- Starting a Countdown that is already running replaces the old one on screen.
Logic and memory
| Node | What it does | Inputs | Events (When) | Settings |
|---|---|---|---|---|
| Relay | Passes Trigger on to its outputs. Use it as a hub: one input, many outputs with different delays. | Trigger, Enable, Disable, Toggle | OnTrigger | None |
| Random | Trigger runs one of its OnPick outputs, picked at random. | Trigger, Enable, Disable | OnPick | None |
| Logic gate | Two on/off inputs, A and B, combined by a gate. | SetA, SetB (value: on, off or toggle; also 1/0, true, yes), Check, Enable, Disable | OnTrue, OnFalse (when the result changes), OnChanged | Gate: AND, OR, XOR, NAND, NOR, NOT (A off) |
| Counter | A number. | Add, Subtract (value = amount; empty = 1), Set (value), Reset, Enable, Disable | OnChanged, OnHitMax, OnHitMin, OnIncreased, OnDecreased, OnReset | Starts at; Lowest; Highest (default 0–10); Back to the start after the highest |
| Compare | Compares a variable with a number. | Check, Enable, Disable | OnTrue, OnFalse, OnChanged | Variable; Is: equal to, not equal to, more than, less than, at least, at most; Value |
| Branch (true / false) | Remembers true or false. | SetTrue, SetFalse, Toggle, SetValue (on / off / toggle), Test, Enable, Disable | OnTrue, OnFalse (on Test), OnChanged | Starts true; Also fire OnTrue / OnFalse on every change |
| Case (switch) | Matches a value against up to 8 cases. | Value (the value to check), Enable, Disable | OnCase1–8, OnDefault (no match) | Case 1–8 (a number or word; empty = unused). Defaults 1, 2, 3 |
| Sequence (steps) | Steps through outputs, one per Next. | Next, Previous, Reset, Enable, Disable | OnStep1–8, OnLoop, OnEnd | Steps 2–8 (default 3); Back to step 1 after the last |
- Gate: the first time A or B is set, it fires OnTrue or OnFalse. After that it fires only when the result flips. Check fires the current result even if it hasn't changed. OnChanged fires only on a real flip.
- Counter: values are kept between Lowest and Highest. Reaching Highest fires OnHitMax; with "Back to the start" it then jumps back to Starts at. Reset sets it to Starts at and also fires OnReset.
- Compare checks by itself whenever its variable changes, and fires only when the result flips. Check always fires.
- Case: numbers match as numbers (
3=3.0), words match ignoring case. Feed it a vote's winner number, a counter's value or a word from a page. - Sequence: Next goes 1 → 2 → 3. After the last step it either loops (OnLoop, then OnStep1 again) or stops and fires OnEnd once, until Reset. Previous goes back one step and fires that step again; at step 1 it does nothing.
Windows
| Node | What it does | Inputs | Events (When) | Settings |
|---|---|---|---|---|
| Custom page | A window that opens on players' screens when its Open input fires (from a button, trigger, timer, chat word…). | Open, Close, Enable, Disable | OnOpened, OnOption1–8, OnAnyOption, OnClosed | Opens for (audience); Window title; Text in the window; Button 1–8 labels; Each button asks "Are you sure?"; The window closes after a button; Window color |
Button (multiple), above, is the same window opened by pressing E on a body. Windows are covered in more detail under Votes and windows.
Only if: conditions on outputs
Any output can have up to three conditions. It runs only when they hold, so one button can do different things for different people. Conditions are checked against the activator at the moment the output fires, before its delay.
In the output editor:
- Only if sets the mode: ALL of them are true (AND) or ANY of them is true (OR).
- If 1, If 2, If 3: pick a condition. "(no condition)" leaves that row empty.
- value: what the condition checks against. Not every condition needs one.
- NOT: flips that one row, so "not an admin" or "does not hold a crowbar".
The output list shows the conditions after the action, for example [only if rank vip and not crouch].
| Condition | value | True when | Players' own nodes |
|---|---|---|---|
| The activator is an admin | None | A toolbox admin set it off | Yes |
| The activator is a player | None | A player (not an NPC, prop or nobody) | Yes |
| The activator is alive | None | They are alive | Yes |
| Their rank is | Ranks, comma separated: vip, moderator |
Their user group is one of them | Admins' nodes only |
| Their job is | Jobs, comma separated: Police, Chief |
Their job (or team) name is one of them | Admins' nodes only |
| They have the license | A license id: gun |
They own it | Admins' nodes only |
| They have at least money | An amount: 500 |
They can afford it (nothing is taken) | Admins' nodes only |
| Their health is at least | A number: 50 |
Health ≥ the value | Yes |
| They hold the weapon | A class: weapon_crowbar |
It's their active weapon | Yes |
| They crouch | None | They are crouching | Yes |
| A variable | name >= 5, or ==, !=, <, >, <= |
The variable compares true | Yes |
| A switch node is on | A node id: L12 |
That switch is on | Admins' nodes only |
| Chance | A percent: 25 |
Random roll, 25% of the time | Yes |
| They are wanted / They have a search warrant / They are in jail / They are handcuffed (v3.6.21.6.1) | None | That is true for the activator | Yes |
| They are police / They are the Mayor (v3.6.21.6.1) | None | Their job has the police / Mayor ability | Yes |
| They are in a Game Modes match / They are in build mode (v3.6.21.6.1) | None | That is true for the activator | Yes |
| Their level is at least (v3.6.21.6.1) | A level: 10 |
Match stats level ≥ the value | Yes |
| Their bank has at least (v3.6.21.6.1) | An amount | Bank ≥ the value | Admins' nodes only |
| There is a lockdown (v3.6.21.6.1) | None | A Mayor's lockdown is on | Yes |
| It is day / It is night (v3.6.21.6.1) | None | The in-game hour is 8:00–17:00 / 20:00–5:00 | Yes |
| The in-game hour is between (v3.6.21.6.1) | 18-6 (over midnight works) |
The in-game hour is in that range | Yes |
| The weather is (v3.6.21.6.1) | clear, cloudy, fog, rain, storm or snow |
The toolbox's weather | Yes |
| At least players are online (v3.6.21.6.1) | A number | That many players (not bots) are on | Yes |
| The treasury has at least (v3.6.21.6.1) | An amount | The treasury ≥ the value | Admins' nodes only |
- Names and ranks are matched ignoring case. Spaces after commas are fine.
- With no activator (a Timer, Clock or Map start), the player-based conditions are false. Use NOT, or variable, switch and chance conditions, for those.
- To get if / else, make two outputs for the same event with the same condition, one with NOT ticked.
- Players' own nodes can't use the admin-only conditions, because those read other people's money, licenses, ranks or switches. If such a node is saved with them, those conditions are dropped.
Actions (Do)
An output's Do button opens a searchable list of every action, grouped into 18 categories (v3.6.21.6.1: Economy, Menus & screens, Police & Mayor and World are new, and the Game modes action shows in the list again). The list only shows the actions you may use. Who in the tables below means whose nodes may run the action: Anyone (players with the tool too), Admins or Superadmins.
An admin action runs only while the node was last saved by a toolbox admin. If a player edits and saves their own node, the admin actions are dropped from it. The editor warns you under such actions.
Audiences ("To", "Who", "For", "Shown to")
| Audience | Who gets it |
|---|---|
| The one who set it off | The activator only |
| Everyone (admins and players) | Every player on the server |
| Players only (not admins) | Everyone except toolbox admins |
| Admins only | Toolbox admins only |
| Everyone near the node (1000) | Players within 1000 units of the node |
| Everyone inside this trigger | Players inside the node. This works on trigger boxes, spheres, plates and zone watchers; anywhere else it means "near". |
| The activator's team / job | Everyone on the activator's team or job |
On players' own nodes, every audience reaches only players near the node (1000 units): Everyone and Players only become Everyone near the node, and Admins only and The activator's team count only the ones nearby. Players' own nodes also have size caps (boxes and walls 2048 units a side, spheres and "nearby" 1024), a quarter of the server's logic budget each second, and at most 100 outputs waiting on a delay (300 for all players together; admins' nodes are not limited).
Places ("Place" fields)
- At the node: the node's body, box centre or marker.
- At the activator: 80 units in front of them.
- At the warp: name: a World > Warps warp point. Players' own nodes may only use public warps.
Logic
| Action | Who | Target | Fields and notes |
|---|---|---|---|
| Logic node: send an input | Anyone | A node (players: their own) | Input: picked from the target's inputs. Value: for Add / Subtract / Set (a number), SetA / SetB / SetValue (on, off, toggle), Value (a number or word). |
| Change a variable | Admins | None | Variable, Do (Set to, Add, Subtract), Value |
Doors
| Action | Who | Target | Fields and notes |
|---|---|---|---|
| Door / mover / elevator | Anyone | A door, mover or elevator near the node (players: their own, not map doors) | Do: Open, Close, Toggle, Lock, Unlock |
Messages & HUD
| Action | Who | Fields and notes |
|---|---|---|
| Show a message | Anyone | Text ({name} = the activator), To (audience), As: Notice, Chat line or Big text |
| Show text on the HUD | Anyone | Title, Second line, To, Seconds (1–60), Color, Where: top, middle or bottom of the screen |
| Announcement (big, with sound) | Admins | Text, To, Seconds (2–30) |
Sounds & music
| Action | Who | Target | Fields and notes |
|---|---|---|---|
| Play a sound | Anyone | None | Sound (with a browser and a Play button), Where: At the node, At the activator, For everyone (2D; admins' nodes only, otherwise it plays at the node), or For the audience below (2D); Audience; Volume %; Pitch % (30–255) |
| Music: play or stop | Anyone | None | Do: Play, Play on loop, Stop. Sound or mp3/ogg link (links only on admins' nodes). For (audience); Volume % |
| Sound emitter on / off | Anyone | A World > Sounds emitter | Do: Turn on, Turn off, Toggle, Play once now |
Players
| Action | Who | Fields and notes |
|---|---|---|
| Player: health, weapons, speed, freeze, job… | Anyone (players: Shake, Flash and Push only, on the activator) | Do (list below), Value, Who (audience) |
| Teleport to a warp | Anyone (players: public warps, the activator only) | Warp point name, Who. NPCs can be teleported too. |
| Give the activator… | Admins | What: Weapon (class), Health, Armor, Money, Ammo for the held weapon. Class or amount |
| Take the activator's weapons | Admins | None |
| License: give or take | Admins | Do: Give or Take. License id: gun, driver, food, medical, business, general, property, tool, or a custom id. Who |
| Hurt the activator | Admins | Damage (0 = kill). Works on NPCs too. |
The Player action's "Do" list, and what its Value means:
| Do | Value |
|---|---|
| Heal by / Give armor | Amount (default 25), up to their max |
| Set health to | Health (default 100) |
| Kill, Respawn, Take all weapons, Unfreeze, Unjail | None |
| Give weapon | Weapon class (weapon_crowbar) |
| Give ammo for the held weapon | Amount (default 30) |
| Freeze for N s / God mode for N s / Set on fire for N s | Seconds (defaults 5 / 10 / 5) |
| Speed % / Jump % / Gravity % for 30 s | Percent (defaults 150 / 150 / 50), then back to normal |
| Size % for 60 s | Percent, 25–300 (default 50) |
| Shake the screen | Strength 1–50 (default 8) |
| Flash the screen | A color: red, green, blue, white, black, yellow, orange, purple, or r g b |
| Push | Force (default 600; up to 1500 on players' nodes, 5000 on admins'). Pushes along the node's facing; trigger areas push up. |
| Money | Plus or minus amount |
| Set job | Job name (unemployed = none) |
| Jail for N s | Seconds, 5–86400 (default 60) |
| Player model | Model path |
| Bank money (v3.6.21.6.1) | Plus or minus amount |
| Give XP / Give match credits (v3.6.21.6.1) | Amount (match stats XP / Armory credits) |
| Give a buff / food / drug effect, Give food to eat later (v3.6.21.6.1) | The buff or food id (burger, meth...; Furniture & Buffs) |
| Revive where they died (v3.6.21.6.1) | None (dead players only) |
| Ragdoll / Blind / Invisible / Infinite ammo for N s / Make sick for N s (v3.6.21.6.1) | Seconds |
| Noclip on / off, Build mode on / off (v3.6.21.6.1) | 1 on, 0 off |
| Gag / Mute for N minutes (v3.6.21.6.1) | Minutes (0 = until lifted); Ungag and Unmute take nothing |
| Warn (v3.6.21.6.1) | The reason. The Warning Ladder applies |
| Title (v3.6.21.6.1) | The title (empty = none) |
| Rocket them into the sky (v3.6.21.6.1) | 1 = they explode at the top |
| Slap, Put out the fire, Their own model back, Give keys, Give their loadout again (v3.6.21.6.1) | None |
| Max health to / Set armor to (v3.6.21.6.1) | A number |
NPCs, props, entities, vehicles (admins)
| Action | Target | Fields and notes |
|---|---|---|
| NPCs: spawn, kill, remove, attitude, send | None | Do: Spawn, Kill all, Remove all, Make them hostile to players, Make them friendly to players, Send them to the place. NPC class, Weapon, How many (1–20), NPC tag (given on spawn; otherwise only NPCs with that tag are affected), Place |
| Props: spawn, remove, freeze, break, ignite | None | Do: Spawn, or Remove / Freeze / Unfreeze / Break / Ignite props nearby. Model, Place, Nearby = within (16–4000), Spawn frozen. Map props and perma props are never removed or broken. |
| Spawn an entity | None | Entity class (searchable), Place, Remove after (s, 0 = keep) |
| An entity: remove, ignite, hide, color, input… | An entity (Scan / pick, with a map scan) | Do: Remove, Ignite (value = seconds), Put out, Freeze, Unfreeze, Hide (no collision), Show, Color (r g b or a name), Set health, Break / kill, Fire an input (value = Input, param), Unbreakable (value 1 / 0, until the map restarts; not players; v3.6.21.6.1) |
| NPC orders: follow, attack, hold, wander (v3.6.21.6.1) | None | Do: Follow the activator, Attack the activator, Hold at the place, Wander, Back to their own AI. NPC class (empty = any), NPC tag, Place, Only within (0 = the whole map) |
| Media players & radios nearby (v3.6.21.6.1) | None | Do: Play a link (YouTube, a stream, a web page...), Stop, Pause, Resume, Turn off, Turn on. Which (both, media players, radios), Place, Nearby = within |
| Toolbox lights nearby: on / off (v3.6.21.6.1) | None | Do: Turn on, Turn off, Toggle. Place, Nearby = within. Not saved: lights come back as placed after a restart |
| Map entity: fire an input by name | None | Map entity name (targetname), Input (Open, Toggle, TurnOn…), Parameter. Hits every entity with that name. |
| Vehicles: spawn, lock, unlock, eject, remove | None | Do: Spawn, Lock nearby, Unlock nearby, Throw out the drivers nearby, Remove nearby, Put the activator in the nearest. Vehicle (searchable), Place, Nearby = within |
At a place
| Action | Who | Fields and notes |
|---|---|---|
| Explosion | Admins | Place, Size / damage (0–500), Hurts (off = only a show) |
| Effect | Anyone | Effect: explosion, big explosion, energy ball burst, sparks, metal sparks, electric spark, water splash, dust ring, strider blood, blood, glass, balloon pop, tesla zap, magic puff, vortigaunt dispel. Place, Size (1–10) |
| Lightning strike (v3.6.21.6.1) | Admins | Place, Damage (0–1000), Hits within (0–1000) |
| Fireworks (v3.6.21.6.1) | Admins | Do: A firework rocket, A fountain of sparks, A show. Place, Color, Height |
Economy (v3.6.21.6.1)
| Action | Who | Fields and notes |
|---|---|---|
| Money: wallet, bank, treasury, cash | Admins | Do: Wallet: add (a minus takes), Bank: add, Wallet: set to, Bank: set to, Treasury: put in (a minus takes out), Drop cash at the place. Amount, Who (wallet / bank), Place (cash). Shown as "Logic" in the Money Log |
Menus & screens (v3.6.21.6.1)
| Action | Who | Fields and notes |
|---|---|---|
| Open a menu or window | Anyone (players' nodes: for the activator only, one window per 10 seconds; not the bank or a store) | Open: F3 hub (or its Jobs, Store, Stats or Help tab), Loadout screen (F4), Backpack, Pockets, Phone Book, Mail, The rules, Armory / Create a Class, Citizen look, Treasury (who may open it), Black market (dealers), Bank (admins' nodes: only for players within 300 units of the node, and only for 5 minutes), A store (value: its id; admins' nodes: like the bank, near the node for 5 minutes). For (audience). Each window keeps its own rules (a phone needs the Phone License, the treasury its ability) |
Police & Mayor (v3.6.21.6.1)
| Action | Who | Fields and notes |
|---|---|---|
| Police & Mayor | Admins | Do: Make wanted (value: reason), Clear wanted, Search warrant (value: reason), Lift the warrant, Handcuff, Take off the handcuffs, Start a lockdown (value: reason), End the lockdown, Add a law (value: the law), Remove a law (value: its number; empty = the newest), Back to the server's laws. Who (wanted, warrant, cuffs). Needs the Mayor features on (Settings > Mayor & Laws). The chat names no player: "X is wanted: reason" |
World (v3.6.21.6.1)
| Action | Who | Fields and notes |
|---|---|---|
| Day, night & weather | Admins | Do: Set the time (value: hour 0–24, e.g. 20.5), Stop the clock, Let the clock run, Set the weather (Weather below) |
| Every door on the map: open / close (in Doors) | Admins | Do: Open or Close. Which doors: every door, doors nobody bought, bought doors |
| Mail (in Messages & HUD) | Admins | Title, Text ({name} = the activator), To. Lands in the mailbox (!mail) from "Server" |
Spawners & zones
| Action | Who | Target | Fields and notes |
|---|---|---|---|
| NPC spawner on / off | Anyone (players: their own) | A World > NPC spawner | Do: Turn on, Turn off, Toggle, Spawn now |
| Item spawner on / off | Anyone (players: their own) | An item spawner | Same as above |
| Zone on / off | Admins | A World > Zones zone | Do: Turn on, Turn off, Toggle. Off is not saved; it resets with a cleanup. |
Votes, Game modes, Admin
| Action | Who | Fields and notes |
|---|---|---|
| Vote | Admins | See Votes and windows below |
| Game mode | Admins | Do: Open a lobby for the mode, Start now (skip the lobby wait), End the round (draw), End the match, Add score to a team (team 0 = the activator's), Put the activator in a team, The activator joins / leaves the match. Mode id, Team, Value |
| Admin: clean up, kill all, freeze all, time… | Admins | Do: Remove every player's props, Clean up the whole map, Clear decals, Kill every player (not admins), Kill every NPC, Freeze / Unfreeze every player, Take everyone's weapons (not admins), Heal everyone, Respawn every dead player, Time scale (0.1–2), World gravity (600 = normal); v3.6.21.6.1: Remove corpses and clear decals, Clear every decal (also the kept ones), Let everyone out of jail, Lock / Unlock the server, Server mode (value 0 Sandbox, 1 Build / PvP, 2 RP), Make a backup of the toolbox's data, Collect the property tax now. Value |
| Write to the Action Log (v3.6.21.6.1) | Admins | Text ({name} = the activator), Also post it to the Discord logs (the Server category) |
| Kick from the server (v3.6.21.6.1) | Superadmins | Reason, Who. Never kicks staff or the node's owner |
| Change the map | Admins | Map, In seconds (0–600) |
| Server console command | Superadmins | Command, run on the server console |
| Custom script (Lua) | Superadmins, and only with kgxat_logic_script 1 |
Lua. It can use activator, node (its id), depth and fire(id, input, value) to send an input to another node. Errors go to the server console. |
Variables, votes and windows
Variables
Variables are named numbers shared by the whole server. Use them for scores, stages, how many keys were found, or whether the vault is open.
- Set them with the admin action Change a variable (Set to, Add, Subtract).
- Read them with a Compare node (fires OnTrue / OnFalse when the result flips), or the A variable condition (
keys >= 3). - Show them on the HUD with the token
{x:lv_name}in Settings > HUD, for example "Keys: {x:lv_keys}". - Names: letters, digits,
_and-, lower case, up to 32 characters. Anything else is stripped. A variable never set counts as 0. - Up to 64 variables per map. They last until the map changes or the server restarts; a cleanup doesn't reset them. Values run from −1,000,000,000 to 1,000,000,000, and decimals work.
Use a Counter instead when you only need a number inside one puzzle: it has limits, OnHitMax and Reset. Use a variable when several nodes, conditions or the HUD need to read it.
Votes
The Vote action (admins' nodes) starts a server vote. Every player sees the normal vote panel.
| Vote | What it asks | Options field |
|---|---|---|
| Yes or no | Your question. Passes when Yes reaches Yes needed % (with at least one Yes). | Not used |
| A poll | Your question, with your answers | Answers, comma separated (up to 9) |
| The next map | Which map next; the winner is loaded | Maps, comma separated, or empty = the map pool |
| The server mode | Sandbox, Build / PvP, RP…; the winner is switched to | Not used |
| A Game Modes match | Which mode to play; the winner's match starts | Mode ids, comma separated, or empty = every mode (up to 9) |
| A job election | Who becomes the Job name | Not used. Candidates: the activator (a yes / no vote), everyone online, or everyone near the node (up to 9). The winner becomes the job if it isn't full. |
Other fields: Question ({name} = the activator), Seconds (10–300, default 30), Yes needed % (yes / no votes and one-candidate elections).
Reacting to the result works in two ways. You can use both.
- On the node that started the vote: add outputs for OnVoteWin (passed, or has a winner) and OnVoteLose (failed, or nobody voted). The activator is the person who set off the vote. This is the easy way: When OnVoteWin, Do Teleport to a warp.
- A result node (optional target): pick a node. It gets Result node: input on yes / a winner (default Trigger), with the winning option's number as the value, or input on no / nobody (empty = none). Send the winner into a Case node (input Value) to branch on which option won: OnCase1 for option 1, OnCase2 for option 2, and so on.
If a vote can't start (another vote is running, or the job doesn't exist), OnVoteLose fires right away. Each node runs one vote at a time.
Windows: Button (multiple) and Custom page
Both show the same window: a title, a text (up to 1000 characters, multiple lines) and up to 8 buttons. A button with an empty label isn't shown.
- Button (multiple) is a body players press with E. The window opens for whoever pressed. Its Open input opens it for the activator.
- Custom page has no body. Its Open input opens it for its Opens for audience, and Close closes it for them. Open it from anything: a trigger box ("Welcome to the shop"), a timer, a chat word, a Map start, a vote.
| Event | When |
|---|---|
| OnOpened | The window opened. Fires once per player it opened for; that player is the activator. |
| OnOption1 … OnOption8 | That button was clicked. The activator is who clicked. |
| OnAnyOption | Any button was clicked (fires along with OnOptionN) |
| OnClosed | The player closed the window themselves |
- Each button asks "Are you sure?" first: a Yes / No box before the click counts.
- The window closes after a button: off keeps it open, so players can click several buttons (a jukebox, a shop).
- A click only counts from the window the server opened for that player, while they're alive and the node is enabled. For Button (multiple), they also have to stay within 250 units of the body.
- Combine the buttons with Only if conditions to make a shop: Option 1 "Buy armor (500)" → Give armor only if they have at least 500, plus Player: Money −500 with the same condition.
Countdown on screen
A Countdown node shows big text with the time left ({time}) to its audience, in its color. Then it fires OnFinished, with whoever started it as the activator. Cancel or Disable removes it from screens and fires OnCanceled. A map cleanup clears every countdown.
Copy, presets, debugging and permissions
Copy and paste
- Copy one node: E + right-click it, or click Copy node in its editor, or right-click it in the node list.
- Paste: set Mode to Paste and left-click. The copy keeps the kind, name, settings, outputs and facing, and a box keeps its size. Outputs that pointed at other nodes still point at those same nodes.
- Players (not admins) paste by the same rules as saving: outputs to doors, nodes, spawners or sound emitters that are not theirs are left out, an Entity watcher must watch something of theirs, and they cannot paste a Zone watcher. This holds for presets too.
- Pasting an Entity watcher needs you to aim at the new entity to watch. A Zone watcher must be pasted inside a zone.
Group copy
A group copy keeps a whole build together, such as a door puzzle with its buttons, relay and counter. Make one in any of these ways:
- Ctrl / Shift + click nodes in the node list, then Copy the selected nodes together (up to 64).
- Copy every node within 256 units of me.
- With the tool: Shift + E + right-click each node to add it (again to remove it).
When you paste a group, the nodes are placed around where you aim and keep their spacing. Outputs between the copied nodes are rewired to the new copies, so the pasted puzzle is a separate working puzzle, not a remote control for the old one.
Presets
- Save as preset… in a node's editor saves the node as it was last saved, so click Save first.
- Presets work on every map and anyone with the Logic tool can paste them. Up to 200, kept in
data/kgx_admin_toolbox/logic_presets.json. - Saving under an existing name replaces it, if it's yours. Admins may replace or delete anyone's.
- To use one, pick it in the panel's Presets list, click Paste the selected preset, then left-click. Paste the copied node instead switches back to your clipboard.
Debugging
- With the Logic tool out, every node is drawn, with lines to everything its outputs drive.
- Show nodes and fires without the tool (
kgxat_logic_debug 1) keeps that view without the tool. It also shows a feed of the last 8 fires on screen ("Vault button: OnPressed (Kris)") and prints them to your console as[Logic]. Only players who may use the Logic tool get it. - The editor's Now: line shows the live state, and Test fires any event with you as the activator.
- If a chain stops halfway, look at the server console for "more than 400 actions in one second" (a loop) or a "logic action …" error. Then check the Only if conditions, and whether a node is disabled.
Who may use Logic
| Who | Can do |
|---|---|
| Toolbox admins | Every node on the map, every kind and action except the superadmin ones |
| Superadmins | Also Server console command and Custom script (the script also needs kgxat_logic_script 1). With a server owner set (v3.6.12, kgxat_owner add <SteamID> in the server console), only owners' nodes may; nodes saved before keep working until someone else saves them. |
Players given the tool in Player Access, or everyone with kgxat_logic_players 1 |
Their own nodes only, up to their limit (Settings > Limits > "Logic nodes (Logic tool)", default 20) |
Tool Visibility and the Tool license can hide or gate the Logic tool like any other tool.
What players' own nodes cannot do:
- Use admin actions, or the Server events and Clock kinds. Zone watchers, custom models and invisible looks are admin-only too.
- The Player action is limited to Shake, Flash and Push, on the activator.
- Reach everyone: Everyone and Players only become "near the node". "For everyone (2D)" sounds play at the node instead, and music links don't play.
- Teleport anyone but the activator, or use warps that aren't public.
- Drive things that aren't theirs: doors (their own, never map doors), other nodes, spawners, or watched entities. Outputs aimed at someone else's things are dropped when they save, with a notice saying how many.
- Use the admin-only conditions (rank, job, license, money, switch).
- Edit an admin's node.
Other ways into logic
- Talking NPCs: a dialogue choice set to Fire logic with the value
L12(orL12:Input) sends an input to that node, with the talking player as the activator. Without an input it sends the node's usual one: Press for a button, Toggle for a switch, FireNow for a timer, Add for a counter, Check for a gate or compare, Trigger for everything else. A talking NPC placed by a player only drives that player's nodes. - Entity watchers on toolbox buttons, keypads and teleporters turn those tools into logic sources.
- Every node placed, edited, pasted or removed is written to the admin log.
Settings at a glance
| Setting | Default | What it does |
|---|---|---|
kgxat_logic |
1 | 0 = no logic runs |
kgxat_logic_rate |
400 | Most actions per second, server-wide (50–5000) |
kgxat_logic_players |
0 | 1 = every player may use the Logic tool for their own nodes |
kgxat_logic_script |
0 | 1 = Custom script outputs run |
kgxat_logic_debug (your own) |
0 | 1 = see nodes and fires without the tool |
Recipes
Each recipe is a full build. Bold words are what you pick in the editor. "Add output" means: in the node's editor, click Add output, set When, pick Do, pick the Target, then fill in the fields. Click Save on every node when you're done.
1. A button that opens a door for 5 seconds
- Place a Button next to the door. Set Cooldown to 6 so it can't be pressed while the door is open.
- Add output: When OnPressed → Do Door / mover / elevator → Target: the door → Do Open.
- Add output: When OnPressed → the same door → Close, Delay 5.
- Optional: When OnTooSoon → Show a message "Wait for the door" To The one who set it off.
2. A VIP-only door, with an answer for everyone else
- Place a Button. Add output: When OnPressed → door Open. Only if: If 1 = Their rank is, value
vip, superadmin. - Add output: When OnPressed → Show a message "VIP only" To the activator. Only if: the same condition with NOT ticked.
That is the pattern for if / else with any condition: job, license, weapon, health, money or a variable.
3. An elevator panel
- Make warp points with World > Warps:
floor1,floor2,roof. An admin's node can use any warp. A player's own node can only use public warps. - Place a Button (multiple). Set Window title "Elevator", Button 1 "Ground floor", Button 2 "Second floor", Button 3 "Roof", and HUD prompt "Elevator".
- Add outputs: When OnOption1 → Teleport to a warp
floor1, Who the activator; OnOption2 →floor2; OnOption3 →roof. - Optional: When OnAnyOption → Play a sound
plats/elevbell1.wavAt the activator.
4. Find the three hidden switches
- Place a Counter: Starts at 0, Lowest 0, Highest 3.
- Place three Buttons with Look Invisible behind paintings, each with HUD prompt "Something's here".
- On each button add output: When OnPressed → Logic node: send an input → the counter → Input Add. Tick Only once.
- On the counter add outputs: When OnHitMax → vault door Open, and When OnHitMax → Announcement "{name} opened the vault!" To Everyone.
- Nothing more is needed for a restart: a map cleanup resets the counter and the Only once marks by itself. For a reset without a cleanup, add an admin button that sends Reset to the counter.
5. Two players must stand on two plates
- Place two Pressure plates (A and B) and a Logic gate with Gate AND (both).
- Plate A: OnPressed → gate SetA, Value
on; OnReleased → gate SetA, Valueoff. Do the same on plate B with SetB. - Gate: When OnTrue → door Open; When OnFalse → door Close.
6. Vote to go to the arena
- Make a warp called
arena. Place a Button with label "Vote: arena" and Cooldown 60. - Add output: When OnPressed → Vote → Vote Yes or no, Question "{name} wants to go to the arena. Go?", Seconds 30, Yes needed 50. Leave the result node empty.
- Add output on the same button: When OnVoteWin → Teleport to a warp
arena, Who Everyone. - Add output: When OnVoteLose → Show a message "The vote failed" To Everyone near the node.
7. A poll that branches with Case
- Place a Case node with Case 1 =
1, Case 2 =2, Case 3 =3(the defaults). - On a button: When OnPressed → Vote → A poll, Options
Arena, Race track, Hide and seek. Target: the Case node. Result input on a winner: Value. - On the Case node: OnCase1 → teleport everyone to
arena, OnCase2 →race, OnCase3 → Game mode Open a lobby forhideseek, OnDefault → a message "Nobody voted". The OnDefault only fires if you also set Result input on no / nobody to Value.
8. A round start with a countdown and a barrier
- Place an Invisible wall across the spawn exit, with Starts on.
- Place a Countdown (on screen): Seconds 10, Text "Round starts in {time}", Shown to Everyone, Color Red.
- Place a Switch for the admin, labelled "Start round". When OnOn → countdown Start.
- Countdown: When OnFinished → wall Disable; When OnFinished → Announcement "GO!"; When OnFinished → Play a sound For everyone.
- Switch: When OnOff → countdown Cancel, and wall Enable.
9. A shop counter (Custom page)
- Place a Trigger box in front of the counter, Reacts to Players.
- Place a Custom page: Opens for The one who set it off, title "Gun shop", text "Pick an item", Button 1 "Pistol (200)", Button 2 "Armor (500)". Untick The window closes after a button.
- Box: When OnPlayerEnter → page Open; When OnPlayerExit → page Close.
- Page: OnOption1 → Give the activator… Weapon
weapon_pistol, only if They have at least money200. Add a second output: OnOption1 → Player Money-200, with the same condition. - Do the same for armor. Add NOT-condition outputs that show "Not enough money".
All conditions are checked before any output of that click runs, so taking the money can't block the item.
10. An alarm
- Place a Switch ("Alarm") and a Timer with Every 2 s and Runs from the start off.
- Switch: OnOn → timer Start; OnOff → timer Stop.
- Timer: OnTimer → Play a sound
ambient/alarms/alarm1.wavAt the node; OnTimer → Show text on the HUD "LOCKDOWN" To Everyone near the node, Color Red, 2 seconds. - Optional: on the switch, When OnOn → Door / mover / elevator Lock, for each door.
11. A daily event (admins)
- Place a Clock (real time): When Every day at the time, Hour 20, Minute 0 (server time).
- Clock: OnTime → Announcement "The zombie night starts in 1 minute!"; OnTime → an NPC spawner on / off Turn on, Delay 60; OnTime → the same spawner Turn off, Delay 960.
- Use the editor's Test with OnTime to try it now.
12. Rewards and chat commands (admins)
- Place a Server events node.
- When OnPlayerKill → Player Money
50, Who the activator (the killer). Add Only if Their job isHitmanto pay only that job. - A second Server events node with Chat word
rulesand Hide that chat message: When OnChatWord → a Custom page Open (Opens for the one who set it off) holding your rules.
13. A story that advances step by step
- Place a Sequence (steps): Steps 3, Back to step 1 after the last off.
- Place a button "Next" that sends Next to the sequence.
- Sequence: OnStep1 → HUD text "Find the generator"; OnStep2 → HUD text "Fix the fuse"; OnStep3 → HUD text "Escape!" and the exit door Open; OnEnd → Announcement "{name} escaped".
- A map cleanup puts the sequence back to the start by itself. To restart it without a cleanup, add a button that sends Reset.
14. Spam protection for anything
Put a Cooldown (debounce) between a source and what it drives. Send Trigger to it, and put the real action on OnPass. Set Per to Each player so one player spamming doesn't block the others. On OnBlocked, show "Wait a moment" to the activator.
15. Remove corpses and decals during a Waves match (admins, v3.6.21.6.1)
- Place a Match watcher: Only this mode
survival(the built-in waves mode). - When OnWaveCleared → Admin Remove corpses and clear decals. Between waves the ground is clean again.
- For a long wave too: place a Timer (Every 30 s, Runs from the start off). Match watcher OnRoundStart → the timer Start, OnMatchEnd → the timer Stop; Timer OnTimer → Admin Remove corpses and clear decals.
16. Wanted alerts and a jail welcome (admins, v3.6.21.6.1)
- Place a Police & Mayor events node.
- OnWanted → Show text on the HUD "{name} is WANTED" To Everyone, Color red; and Play a sound For everyone (2D).
- OnJailed → Open a menu or window The rules, For the one who set it off (the jailed player); OnUnjailed → Player Give their loadout again.
17. Night shift (admins, v3.6.21.6.1)
- Place a Day, night & weather events node.
- OnNight → Toolbox lights nearby Turn on (Nearby 8000) and NPC spawner Turn on; OnDay → the same Turn off.
- OnWeatherChanged (only for Thunderstorm) → Lightning strike at a warp, a few outputs with delays.
18. A lockdown siren (admins, v3.6.21.6.1)
- Police & Mayor events: OnLockdownStart → Music Play on loop (a siren) For Everyone, Every door on the map Close (Doors nobody bought); OnLockdownEnd → Music Stop.
Troubleshooting and tips
| Problem | Likely cause and fix |
|---|---|
| Nothing happens at all | kgxat_logic is 0, or the node is disabled ("Now: disabled" in its editor; tick Runs). Turn on debug to see whether the event fires. |
| The event fires but the output doesn't run | An Only if condition is false for that activator. Timers and clocks have no activator, so player conditions fail there. Or Only once already ran: save the node or clean up the map to reset it. |
| "Saved … (N output(s) left out)" | Those outputs used an action you may not use, or aimed at something that isn't yours or no longer exists. |
| An admin action stopped working | A player saved the node after you did. Admin actions run only while an admin saved the node last. Re-save it as an admin. |
| Test does nothing | Test only runs saved outputs. Click Save, reopen, then Test. |
| A delayed output never ran | The node was saved during the delay, which drops waiting actions. |
| A chain stops after a while | The 24-step depth limit, or the rate limit (console: "more than 400 actions in one second"). Break loops with a Cooldown or Only once; for something that repeats forever, use a Timer node. |
| A trigger fires for the wrong people | Check Reacts to and Only (team, job, rank or NPC tag). Remember OnEnter fires for every entity, while OnPlayerEnter is players only. |
| "Everyone" only reaches people nearby | It's a player's own node, so Everyone becomes near the node. Have an admin save it. |
| A teleport does nothing | The warp name is wrong, or it isn't public and the node isn't an admin's. |
| A button's sound doesn't change | Silent is ticked, or the path isn't a game sound. Use .wav / .mp3 / .ogg files from the game, or a sound script name; links don't work for button sounds. |
| A Compare node never fires | It fires only when the result flips, or on Check. Send Check from a Map start node to get the first result. |
| Two nodes need the same "if" | Put the condition on a Branch: set it from one place, and send Test where you need it. Or use a variable and the variable condition. |
Tips
- Name every node. The pickers and the node list show names, and "Vault counter" is easier to find than "Counter".
- Use a Relay as a hub. Point many sources at one relay and give the relay all the outputs. One place to edit, and you can disable the whole contraption with one Disable.
- Delays make sequences. One event with five outputs at 0, 1, 2, 3 and 4 seconds is a scripted scene.
- Invisible buttons and HUD prompts make any wall, painting or prop interactive without a visible button.
- Group-copy finished builds and save the key node as a preset, so you can rebuild a puzzle on another map in seconds.
- Watch it live: keep
kgxat_logic_debug 1on while you build, and turn it off for players.