Log inGet started
World

Open Sesame: Doors, Switches, Locks and Chests Kit

Merged

1.6.0: per-player kept state (saveId + Interact.setStateStore) and Item draw = false

#4
Author
claude-code @ auraAgent
Opened
Nov 8, 2026
From
contrib-1mqpha44
Into
main
Merged
Nov 8, 2026

What: interactKit 1.6.0 adds kept device state and a way to draw items yourself.

  1. Kept state. New Interact.setStateStore({ get = fn(key), set = fn(key, value) }), Interact.stateStore(), Interact.recall(saveId), Interact.remember(saveId, value), and a saveId field on Door, Switch, Lock and Item. A device with a saveId restores its state from the store on its owner (when it starts, or when a store arrives later) and writes it back whenever its owner changes it (Door open, Switch on, Lock locked, Item taken). New internal module interactKit.persist holds the store and a small per-device tracker.

Why: a device spawned with entity.spawn (not synced) is already each player's own copy, since net.isAuthority treats an unsynced entity as local. What was missing was keeping that state between sessions. With a store that writes into the local player's own save (saveKit profile, a cloud save), every player keeps their own doors, levers, locks and taken keys on their own account. Without it a perPlayer key came back next session and could be taken again. A store on the host for synced devices keeps the one shared door between sessions too. Nothing changes for a world that never calls setStateStore: saveId is empty by default and the tracker does nothing.

  1. Item.draw (default true). Off: the Item builds no parts, so a game with its own art (a 2D pixel sprite, its own model) draws the key itself and still gets interactKit's pickup, per-player counting and collect event. Item.shapeKey includes draw so toggling rebuilds.

Used by: sideScrollerKit (Lantern Depths world), whose 2D locked doors are interactKit devices with interactKit key Locks, keys are interactKit Items with draw = false under the kit's pixel sprites, and the switch opens bars through Interact.fire; its store is each player's saveKit profile, so gates and keys are per player and saved.

Tests: 4 new (97 total), passing 97/97 in this world in edit mode: stateStore/recall/remember (no store keeps nothing, a bad store is refused), Door/Switch/Lock writing their saveId, the tracker restoring once per store on the owner and writing changes (and doing neither when not the owner), and draw = false building no parts with a kept perPlayer key staying taken. The public-call coverage table lists the four new calls. Version 1.6.0 in package.yaml, api VERSION, README and the gallery's saved signs (text only).

Source world: a8c98b5b-86a7-474c-9b7a-4a4eb6856130 Contributed paths:

  • interactKit.package/Door.component/init.luau
  • interactKit.package/Item.component/init.luau
  • interactKit.package/Lock.component/init.luau
  • interactKit.package/README.md
  • interactKit.package/Switch.component/init.luau
  • interactKit.package/api.module/init.luau
  • interactKit.package/gallery.scene/scene.json
  • interactKit.package/interactKitTests.testSuite/init.luau
  • interactKit.package/package.yaml
  • interactKit.package/persist.module/.metadata
  • interactKit.package/persist.module/README.md
  • interactKit.package/persist.module/init.luau
  • interactKit.package
  • interactKit.package/Door.component
  • interactKit.package/Item.component
  • interactKit.package/Lock.component
  • interactKit.package/Switch.component
  • interactKit.package/api.module
  • interactKit.package/gallery.scene
  • interactKit.package/interactKitTests.testSuite
  • interactKit.package/persist.module
  • .world_settings
  • interactKit.package/Barricade.component/init.luau
  • interactKit.package/Container.component/init.luau
  • interactKit.package/InteractSettings.component/init.luau
  • interactKit.package/Interactable.component/init.luau
  • interactKit.package/TriggerVolume.component/init.luau
  • interactKit.package/gallery.scene/build.luau
  • interactKit.package/gallery.scene/entrypoint.luau
  • interactKit.package/hud.module/init.luau
  • scenes/main.scene/build.luau
  • scenes/main.scene/scene.json

21 files changed

  • ChangedinteractKit.packageFolderBeforeAfter
  • ChangedinteractKit.package/Door.componentFolderBeforeAfter
  • ChangedinteractKit.package/Door.component/init.luau11.5 KB → 11.9 KBBeforeAfter
  • ChangedinteractKit.package/Item.componentFolderBeforeAfter
  • ChangedinteractKit.package/Item.component/init.luau11.8 KB → 13.0 KBBeforeAfter
  • ChangedinteractKit.package/Lock.componentFolderBeforeAfter
  • ChangedinteractKit.package/Lock.component/init.luau5.8 KB → 6.3 KBBeforeAfter
  • ChangedinteractKit.package/README.md37.8 KB → 37.8 KBBeforeAfter
  • ChangedinteractKit.package/Switch.componentFolderBeforeAfter
  • ChangedinteractKit.package/Switch.component/init.luau10.7 KB → 11.1 KBBeforeAfter
  • ChangedinteractKit.package/api.moduleFolderBeforeAfter
  • ChangedinteractKit.package/api.module/init.luau27.4 KB → 28.5 KBBeforeAfter
  • ChangedinteractKit.package/gallery.sceneFolderBeforeAfter
  • ChangedinteractKit.package/gallery.scene/scene.json149 KB → 149 KBBeforeAfter
  • ChangedinteractKit.package/interactKitTests.testSuiteFolderBeforeAfter
  • ChangedinteractKit.package/interactKitTests.testSuite/init.luau62.2 KB → 66.6 KBBeforeAfter
  • ChangedinteractKit.package/package.yaml2.5 KB → 2.5 KBBeforeAfter
  • AddedinteractKit.package/persist.moduleFolderAfter
  • AddedinteractKit.package/persist.module/.metadata17 BAfter
  • AddedinteractKit.package/persist.module/README.md591 BAfter
  • AddedinteractKit.package/persist.module/init.luau3.2 KBAfter

Checks

No checks have been posted.

Reviews

No reviews yet.

Conversation

No comments yet.

Sign in to comment or review.