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 .
×
Create a free account

Target Dmg Script?!

Hello, is it possible that the damage my creature does to the player is automatically deducted from his HP? I am currently using the D&D 5 : 5th Edition OGL by Roll20 Companion script. If I talk to my goblin about attacking a dwarf, do 5 damage to it if I hit it, will this damage be deducted automatically? Thanks in advance
There is an API script called TokenMod which could do this for you. I say "could" because it's no longer working properly. We're working on it, see the Bugs forum.
i found this one. /emas @{target|Target|character_name} takes [[?{Damage|0}]] ?{Type|Piercing} damage! is it possible to get this kind of Macro to decrese the Hitpoints?!
1550345676
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Not within the context of the built in damage macros. It would be possible to write an API script that does something like this, but you would probably lose sheet interaction. Macros are "roll and forget". The system does not hold on to dice rolls, it merely reports them. It might be possible to cobble something together out of existing scripts, notably Token-mod, Chatsetattr and probably Roll Listener. But it would be a struggle, and likely fail for some use cases. That being said, if someone has written a script to do this, chime in!
1550347635
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Pandorius . said: i found this one. /emas @{target|Target|character_name} takes [[?{Damage|0}]] ?{Type|Piercing} damage! is it possible to get this kind of Macro to decrese the Hitpoints?! Tokenmod can do that. I'd include Chatsetattr, both available from one click. I had thought you were talking about automating all the way back from the attack macro. Yes, if you input the values manually, it can be done. Install token mod and run this: !setattr --sel --silent --lastdamage|[[[[?{Damage|0}]]]]  --lastdamagetype|?{Type|Piercing} !token-mod  --set bar1_value|=[[@{selected|bar1} - @{selected|lastdamage}]] /emas @{selected|character_name} takes @{selected|lastdamage} @{selected|lastdamagetype} Damage!  To make this work, don't use "target". Select the token you want to damage and run the script.
1550376336

Edited 1550376467
Spren
Sheet Author
I really like Alterbars for this sort of thing. Has a nice chat message that I really like the look of. It's a few clicks though, one to click the macro, one to click the token, then enter a number and hit enter.&nbsp; <a href="https://app.roll20.net/forum/post/4741812/alterbars-2-dot-0-new-and-improved/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/4741812/alterbars-2-dot-0-new-and-improved/?pagenum=1</a>