Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

[Script]Locksmith

1786725229
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Locksmith - Automatic Lock-Picking & Knock for D&D 5e (Legacy + Beacon) Roll20 doesn't have a native way to trigger "a player interacts with a locked door," so lock-picking has always meant the GM manually comparing a roll to a DC they're keeping track of somewhere else. I built Locksmith to close that gap for my own table, and figured it might be useful to others too. [ Video Demo ] [ Code Until One-Click Merge ] What it does Set a difficulty on a door or window once (or mark it Unpickable, or Magic-only for Knock), and from then on your players just make Thieves' Tools checks as normal - Locksmith automatically finds the nearest locked door/window in range and resolves it. Works with both the legacy (5e) and Beacon (5.5e) character sheets. Automatic Thieves' Tools resolution - success posts an Unlock button Knock spell support, detected automatically, can bypass Magic-only locks No custom data storage for lock state - the DC lives directly in the door/window's  color property A GM setup menu, with on-map status labels (they turn yellow if a key-holder is already on the map) A full keys and keyrings system - hand out keys directly or generate a custom loot macro for treasure. Each player gets a !keyring report to Use/Give/Drop their keys Can optionally create a !keyring token action for players Full in-game documentation via !lock --help Installation One-Click install (search "Locksmith"), or grab Locksmith.js directly from the repo folder. Getting started Select a door or window, run !lock, and use the Set row to configure it. That's it - !lock --help covers everything else, both for you and for your players. Feedback welcome - this has been built and refined through actual play at my table, so if something doesn't work the way you'd expect, let me know. This script was released early for playtesting, for free, on my  Patreon .
Hi Keith! Another great script from the script king! Would it be possible to add penalties to locks? Example, failing a lockpick by 5 damages the picks. Or failing by 10 or more jams the lock, etc... Great script! Thanks for sharing!!!
1786895928
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Pak! Thanks! There is a lot I would like to add to this, but there are some real limitations. The DC is stored in the color code. This makes it possible to set and then copy/paste, transmogrify, or duplicate them along with pages. Doors and Windows do not have many places where data can be stored,so the color code is it. At the same time, I don't want to shift that color too much visually. I want the user to be able to see doors as orange and windows as cyan. Each step away from the pure color indicates a change in DC. This is also why I cap the DC. The harder the door gets to open, the less it keeps its color. So the amount of data is limited. I have advocated that every Roll20 object should have a description or data field, that just holds a string. There is so much stuff that can be done with that. Doors could store descriptions, descriptions of their keys, noises to play when opened, riddles, all kinds of stuff. Right now though, we're about at the limit of data points I find comfortable storing.
Can't wait to add this to our game.  When a character uses the Knock spell, does it have to be cast from their character sheet or can it be called from another script like Tim's Spellbook, which we also use in  our game.
1786908948
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It looks for key words in the template produced by the character sheet. If Tim's Spell book triggers those sheet abilities, it should work.
Nice! I've been looking for something to handle doors with.  What key words are it looking for? Can these terms be in a ScriptCard? So they need to be in the title or text?
1787162409
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks Eric! It looks for the rolltemplate or msg.type produced by the sheet for the thieves tools or knock spells. If your ScriptCards script triggers the sheet abilities rather than constructing from scratch, it should work. I got very specific on the searching because I wanted to reduce the chance of false positives, and the script also needs to know how to find the result numbers accurately in the case of the tools. For instance, if you don't have advantage or disadvantage set on the legacy script, but are simply always rolling two d20s, it's smart enough to ask for comfirmation on the intended result.