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] Damage Numbers - shows amount of damage done above the token

1774141242

Edited 1774209419
Code What It Does Whenever a token's health changes, this script automatically spawns floating numbers that jump up, arc, and fall with gravity before scaling down and disappearing. Key Features Universal Detection: You don't need to use special macros to make this work. Whether you manually type a new number into the token's HP bubble, drop a massive AoE, or use another script like Token-Mod , this script runs in the background and catches the change automatically. Lag-Free Auto-Cleanup: It features a built-in background "janitor." If the virtual tabletop ever lags or glitches, the script sweeps the map and deletes any stuck numbers so your game doesn't get cluttered. Highly Customizable: Right at the top of the code, there is a simple config section where you can change the text colors (default is white for damage, green for healing), font size, and even how heavy the "gravity" is. Important Note: The Jumpgate "Selection Drop" Quirk If your game is using the Jumpgate engine , there is a known visual quirk with how Roll20 handles creating new text objects during combat: If you have only a single token selected when it takes damage, the VTT will drop your selection. * Why? The engine briefly refreshes the player interface whenever the numbers are spawned. The Silver Lining: If you have multiple tokens selected (like hitting a group of goblins with a fireball), your selection will stay locked. It's a minor tradeoff for the physics animations, but something to keep in mind!  Setup Instructions Install the script in your API settings. By default, the script watches Bar 1 for health changes. If you use Bar 2 or Bar 3 for HP, just change healthBar: 1 to your preferred bar in the configuration section at the top of the code. Save, jump into your game, and start hitting things! Link to code
1774149463
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Two scripts in the same day!
Hi Surok. Just tried this and really like it. Is it just GM who sees this or do players also see it ? Just checking because sometimes I might fudge the damage so if a player is expecting to 20 come on and only see 15 I'll get caught out. If nothing else it might make an honest man of me.
FFR said: Hi Surok. Just tried this and really like it. Is it just GM who sees this or do players also see it ? Just checking because sometimes I might fudge the damage so if a player is expecting to 20 come on and only see 15 I'll get caught out. If nothing else it might make an honest man of me. It shows on the foreground layer by default so everyone sees it. The API doesn't have a menu option but you can hard code the layer change, the settings are at the beginning of the code.