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

[Script] Kill Counter

1507912937

Edited 1507913082
Kirsty
Pro
Sheet Author
This is a silly script that I wrote to keep track of the number (and type!) of monsters that each player kills. It will work for the types of monsters found in D&D/Pathfinder. Link:&nbsp; <a href="https://github.com/Ciorstaidh/Roll20-API/blob/master/Kirsty's%20Kill%20Counter%20v.1.0" rel="nofollow">https://github.com/Ciorstaidh/Roll20-API/blob/master/Kirsty's%20Kill%20Counter%20v.1.0</a> The script will create a new character sheet when first installed called "KillCount". Use the command !killCount to bring up the menu into chat. Clicking on "Add Player" will add a new player (or character) to the KillCount sheet for tracking their kills. Clicking on "Add Kill" will ask you for the player name, type of monster, and number of kills. These will then be added to the Kill Counter sheet. I suggest creating a couple of macros to go with this script. This one will allow you to add a kill at the click of a button. Make sure that you replace PLAYER1|PLAYER2 with the names of the players that you used when you added them via the "Add Player" button. !addKill,?{Name|PLAYER1|PLAYER2},?{Type|Aberration|Beast|Celestial|Construct|Dragon|Elemental|Fey|Fiend|Giant|Humanoid|Monstrosity|Ooze|Plant|Undead},?{Number|1} And this macro will put the kill count in chat for everyone to see. (This is using the OGL sheet template, you can switch it to whatever template works with your sheets. &{template:npcaction} {{name=Total Kills}} {{rname=Kill Counter}} {{r1=r1}} {{description=PLAYER1: @{KillCount|PLAYER1} PLAYER2: @{KillCount|PLAYER2} }} Happy Rolling! May your kills be many!
1507913346
The Aaron
Pro
API Scripter
Fun!&nbsp; You could set up something that automatically tracked this when the TurnOrder is up.&nbsp; It would need to know what bar represented health, but you could have it bump the count and type for the current player if it's their token's turn and other tokens are dropped to 0 HP.&nbsp; &nbsp;=D
Ever since a certain movie with an elf and a dwarf competing on their kill count my players compete like this. I'm going to see about using it. Thanks for sharing.
1507915283
Kirsty
Pro
Sheet Author
That's a really cool idea! I've been working on have g the script pop up on an npc death, but my JavaScript is still pretty rough and it's slow going. I love the idea of it working off of the turn order! I'll keep plugging away at it. :)
1507916364
Kirsty
Pro
Sheet Author
Erich, that's exactly how this script came about in the first place! I'm glad someone else will get some use out of it. :)
Very cool. Is there a DM version? [Insert evil DM grin]
1508237868
GiGs
Pro
Sheet Author
API Scripter
This is a nice script, I'm modifying it for my game. One thing I'd like, is a way to reset/clear all the attribute values. Is there a way to loop through all the attributes on a sheet?
1508239178
GiGs
Pro
Sheet Author
API Scripter
I think I figured out. This seems to work: clearKills = function(msg) { var CountSheet = findObjs({ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type: "character", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name: "KillCount" &nbsp; &nbsp; &nbsp; &nbsp; })[0]; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; var allAttributes = findObjs({&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; characterid: CountSheet.id, type: "attribute",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }); _.each(allAttributes, function(obj) {&nbsp; &nbsp;&nbsp; obj.set('current', 0); }); sendChat('Kill Counter', '/w gm The Kill Count has been reset.'); },
1508284271

Edited 1508284323
Kirsty
Pro
Sheet Author
Oh sweet! That's a good idea, GG. I'll add it to the next update of the script (and make sure you get the credit!). Thanks for sharing. :)
Great API I just installed it in my game, thank you. @ Micheal Of course there is just add a Player called GM and use&nbsp; !addKill,{GM},?{Type|Cleric|Fighter|Monk|Wizard...&nbsp; you get the idea :D
We're having an absolute blast with this Kirsty. Thanks! :) ..so many dead goblins.&nbsp;
1510162291
Kirsty
Pro
Sheet Author
Hahahaha! I'm glad it's working for you! We're using it with Storm King's Thunder and we're racking up quite the numbers too!