heistKit
Version 1.0.0. Light Fingers: the loot half of a heist game for any multiplayer Zero world. 23 kinds of valuable modelled in code as original art, each with a value, a weight and a label; eight ways each one is kept (out in the open, a locked display case with a lock-picking minigame, a wall safe with a dial you turn and listen to, a painting cut from its frame, a key-locked drawer or chest, a pressure-plate pedestal you swap a sandbag onto, a hidden panel); three rules (steal everything listed, reach a value quota, grab one and run before the alarm countdown ends); five escapes that unlock when the rule is met (front door, cellar hatch, window and rope, servants' gate, a waiting carriage); and five looks for the per-player loot list (ledger, pocket notebook, pinned polaroids, minimal, luggage tags). Every choice is one field. Minigames are played with the one interact button on keyboard, gamepad and touch, can be walked away from, and every slip, dial click and cut is a noise aiKit's guards and monsters hear. Heavy loot slows its carrier and makes their steps louder. Every player sees the same loot taken and the same progress; late joiners too.
Install: search ZeroMind for heistKit or run zero zeromind installAsset <heistKit package guid> in the engine shell. It brings interactKit 1.6.8 (prompts), aiKit 1.4.0 (noise), navUiKit 1.3.15 (waypoints, toasts) and juiceKit 1.2.12 (alarm shake).
First example
In a scene's build.luau, inside content(), with a player already set up:
local Heist = require("heistKit.api")
Heist.setup({ rules = "stealAll", hud = "ledger", title = "The Wrenmoor Job" })
Heist.addLoot({ kind = "pocketWatch", access = "open", position = { 2, 0, 4 } })
Heist.addLoot({ kind = "necklace", access = "safe", position = { -3, 0, 8 }, yaw = 180 })
Heist.addLoot({ kind = "painting", access = "frame", position = { 3, 0, 8 }, yaw = 180 })
Heist.addEscape({ kind = "servantsGate", position = { 0, 0, -10 } })
Press Play. The ledger in the top right lists the three pieces. Walk to the watch and press E (gamepad west button, the touch Interact button): it is struck off the list. At the safe, press E to start: hold to turn the dial, let go on the heavy click, three times. At the painting, hold E to cut the canvas from its frame. When all three are taken the gate's lamp turns green and a ring appears; walk into it to escape.
Any of these calls also works from a script in play: there it spawns shared entities on the room host (and does nothing on other peers, whose copies arrive from the host). The components heistKit.HeistDirector, heistKit.Loot and heistKit.Escape carry the same fields for building in the editor without code.
Loot kinds (kind)
| kind | label | value | weight kg |
|---|---|---|---|
pocketWatch | Gold Pocket Watch | 1,200 | 0.2 |
necklace | Jewelled Necklace | 9,500 | 0.4 |
tiara | Diamond Tiara | 14,000 | 0.5 |
signetRing | Signet Ring | 2,200 | 0.1 |
jewelledEgg | Jewelled Egg (an original enamel-and-gold design) | 22,000 | 0.9 |
goldIdol | Gold Idol | 16,000 | 6 (heavy) |
candelabra | Silver Candelabra | 3,400 | 4.5 (heavy) |
chessSet | Ivory Chess Set | 4,800 | 3 |
rareBook | Rare Book | 6,500 | 1.6 |
sealedLetters | Sealed Letters (and the deed) | 5,000 | 0.3 |
painting | Oil Painting | 18,000 | 2.5 |
miniature | Miniature Portrait | 3,800 | 0.2 |
musicBox | Music Box | 2,600 | 1.2 |
decanter | Crystal Decanter | 1,800 | 1.8 |
coinPurse | Coin Purse | 900 | 0.6 |
ruby | The Wrenmoor Ruby | 30,000 | 0.1 |
mantelClock | Mantel Clock | 2,900 | 5 (heavy) |
jadeFigurine | Jade Figurine | 7,200 | 1.4 |
astrolabe | Brass Astrolabe | 8,800 | 2.2 |
pistolCase | Dueling Pistols | 6,000 | 3.5 |
porcelainVase | Porcelain Vase | 12,500 | 4 (heavy) |
cameoBrooch | Cameo Brooch | 2,400 | 0.1 |
silverTeapot | Silver Teapot | 2,100 | 1.5 |
Loot of 4 kg or more is heavy: its carrier walks slower (down to 55%) and clanks (a noise every step of the way). value, weight and label override the kind's own on any piece.
Access methods (access)
| access | how it opens | noise |
|---|---|---|
open | On a marble pedestal; walk up and take it. surface = "none" puts it on your own furniture. | none |
displayCase | Locked glass case. Lock-picking minigame: press Interact while the pick sits in the gold mark; 3 to 5 pins. A miss loses a pin and rattles the case. minigame = false: hold to rake the pins (louder). | 5 m per slip |
safe | Wall safe with a dial. Hold Interact to turn, let go on the heavy clunk; 2 to 4 numbers. Every few ticks of the dial are heard nearby. minigame = false: hold to work it by ear. | 2 m per click |
frame | Painting in a gilt frame on the wall. Hold Interact to cut the canvas out; progress is kept while you stay. Leaves the empty frame with cut edges. | 3 m a second |
keyDrawer | Writing desk with a locked drawer. Needs a key (Heist.addKey), any key or the one with the same keyId. The drawer slides out with the loot in it. | none |
keyChest | Iron-banded chest, key-locked as above. | none |
pressurePlate | Marble plinth with a brass plate. Carry a sandbag (Heist.addSandbag) and it is swapped silently; lift it bare and the alarm bell rings (a loud noise, the director's alarm). | 24 m alarm |
hiddenPanel | Wall panelling; only close up (1.5 m) does a prompt appear. Hold to feel for the catch and slide the panel aside. | 2 m |
difficulty (easy, normal, hard) sets pins, numbers and seconds. noiseScale multiplies every noise a piece makes. Locked pieces open first and are taken with a second press, so one player can crack the safe while another keeps watch and grabs it.
Rules (rules) and options on the director
| field | values | what it does |
|---|---|---|
rules | stealAll (default) | Every listed piece must be taken. |
quota | Take loot until its value reaches quota (0: half of everything on offer). | |
grabAndRun | The first piece taken rings the alarm and starts a countdown (timer, default 90 s); the escapes open at once. With quota set, the escapes open at the quota instead. | |
items | listed / any | Which pieces count and are shown: only listed = true ones (unlisted loot is a bonus), or every piece. |
timer | seconds | grabAndRun's countdown; for the other rules a limit on the whole heist (0 = none). Running out fails the heist. |
hud | ledger, pocketNotebook, polaroids, minimal, tags, none | The loot list look, the same for every player, drawn per player. |
title | text | The heading of the list. |
dropOnKnockout | false | On: a player who goes down (SecondWind, when the game has it) drops what they carry. Off: loot stays stolen once taken. |
heavySlows | true | Heavy loot slows its carrier and makes them noisy. |
tracker | true | Waypoints and toasts through navUiKit. |
Escapes (Heist.addEscape / heistKit.Escape)
| kind | what it is | default radius |
|---|---|---|
frontDoor | Grand double door with a fanlight and steps | 2.5 |
cellarHatch | Stone surround with double cellar doors | 2.2 |
windowRope | Tall sash window; a rope hangs out when open | 2.0 |
servantsGate | Iron gate between brick pillars | 2.5 |
carriage | A waiting carriage, door swinging open | 3.0 |
Each has a red lamp while shut and a solid door or gate (collider) where it has one; once the rule is met it opens, the lamp turns green, a ring shows the zone, and navUiKit marks it. requireAll = true: every player must stand in the ring together (players inside are told how many of the crew are there). Otherwise any player reaching it wins for the whole crew. radius and label override.
Loot list looks (hud)
| look | what it looks like |
|---|---|
ledger | A handwritten paper list with values; taken items are struck through in ink. |
pocketNotebook | A small ruled notebook with a leather spine; pencil ticks in boxes. |
polaroids | Pinned instant photos of every piece on a cork board, crossed out in red. |
minimal | Corner text, nothing else. |
tags | Brown luggage tags on string, stamped TAKEN. |
Every look sits top right inside the safe area, moves down past any on-screen control a game states there (ui.safeArea().controls), shrinks on small screens, shows the rule's progress line, the countdown when there is one, and how much the player carries.
API
local Heist = require("heistKit.api")
| call | does |
|---|---|
Heist.VERSION | "1.0.0" |
Heist.setup(opts) | { rules, hud, quota, timer, items, title, dropOnKnockout, heavySlows, tracker }. Makes the HeistDirector if there is none; sets its fields. Returns its entity. |
Heist.addLoot(opts) | { kind, access = "open", position, yaw = 0, label, listed = true, value, weight, difficulty, minigame, keyId, consumeKey, surface, noiseScale, name }. Returns the entity. Errors on an unknown kind or access. |
Heist.addKey(opts) | { position, keyId = "", label, name }: a key players pick up with Interact. |
Heist.addSandbag(opts) | { position, name }: a sandbag for pressure plates. |
Heist.addEscape(opts) | { kind = "frontDoor", position, yaw = 0, radius, requireAll = false, label, name }. |
Heist.on(name, fn) | On every peer. Names: taken, dropped, opened, ruleMet, ruleLost, escaped, failed, alarm, reset, toolTaken, plateSwapped, minigameOpened, minigameClosed, heistNoise, or "*" (fn(name, ev)). Returns an unsubscribe function. taken carries { loot, kind, label, value, weight, listed, access, by, peer }; escaped { via, value, count, time }; failed { reason }. |
Heist.state() | { phase, rules, hud, items, value, count, listedTaken, listedTotal, totalValue, quota, timeLeft, alarm, escapedVia, failReason, elapsed, title, loot = {...}, escapes = {...} }, the same on every peer. phase is active, ruleMet, escaped or failed. |
Heist.carried(player?) | What a player carries. |
Heist.dropCarried(player, reason?) | Drops everything a player carries where they stand; anyone can pick it up again. Call it when your game knocks a player out. |
Heist.reset() | Everything back as it started, for everyone. |
Heist.fail(reason?) | Ends the heist as failed (all players caught). |
Heist.setHud(style) | Switch the list look for everyone. |
Heist.lootKinds(), accessKinds(), ruleKinds(), escapeKinds(), hudStyles(), toolKinds() | The lists above. |
Heist.info(family, kind) | The data behind one kind ("loot", "tool", "access", "rule", "escape", "hud"). |
Heist.hudTree(style?) | The loot list's widget tree, for menus and previews. |
require("heistKit.thumbs").of(kind) answers the texture guid of a loot kind's photo (an image widget's src), for a game's own menus.
Multiplayer
The same pattern as stealthKit's single-prize Heist, generalised to many pieces. Every shared fact is a synced field written by one peer, the entity's owner (the room host for scene objects): a piece's state (locked, open, taken, dropped), who carries it, who is working its lock (picker), the director's phase, totals and clock, and each escape's open. Players ask through interactKit's prompt (reach-checked by the owner) and heistKit's command channel (heistKit:cmd); events go to every peer on heistKit:evt. A lock is claimed by one player at a time ("Someone is working on it" for the rest) and the claim lapses if that player goes quiet. Late joiners read the fields and see the case open and the frame empty.
Art
Every piece of art (23 loot kinds, the key and sandbag, the eight access props with their moving parts, five escapes, lamps and the ring) is modelled with quick geometry in Art.sceneModule and baked by require("heistKit.bake").run() into artData, which every peer spawns as a Generator at runtime, so the art is the same in the editor, in play and in a published game. Edit Art.sceneModule, then run the bake. art/thumbs holds a photo of each loot kind.
Guides
how-to-add-a-heist-with-loot-safes-and-an-escape-to-my-gameexample-build-a-small-haunted-heist-level-with-mansionKit-heistKit-and-ghostKit
Open them in the Docs panel or with man <name>.
Tests
zero tests run heistKitTests in edit mode.
Known limits
- The minigame and the HUD read the default input map's
interact; a game that rebinds Interact elsewhere should keep that action. - Heavy-loot slowing scales the carrier's
CharacterController.moveSpeed; a game with its own movement controller readsHeist.carried()and slows the player itself. dropOnKnockoutuses SecondWind when the game has it; other games callHeist.dropCarried(player).
Comments · 0
Open discussion, no rating attached. Ask questions, swap notes, follow threads.
Documented parts · 4
- caughtmodule
- Galleryscene
- HeistDirectorcomponent
- heistKitpackage