Read rooms and count inventory
BASIC IN YOUR GAME
Is the player carrying the battery, or does the battery merely exist in your database? Those are two different questions. InventoryCount tells you what the character actually has.
FUNCTION Run()
DIM before = InventoryCount("cell")
AWAIT AddInventory({"itemId": "cell", "count": 1})
RETURN InventoryCount("cell") - before
END FUNCTIONHere cell is an existing inventory item ID. The first line counts what the player already has. After the action, the difference is 1, whether the count started at zero or higher. Supply the optional character ID to InventoryCount when checking another character.
FUNCTION Run()
RETURN rooms.lab.name
END FUNCTIONRead this as “the name field on the room whose ID is lab.” In the preview it returned 01 · Blockout Lab. Use the actual ID from your own room record.
Other record families include characters, objects, triggers, guis, dialogues, quests, objectives, assets, cameras and spawns. After typing the record name and a dot, use the editor’s completions to look for fields available on that record.
