matthileo

Untitled

Sep 11th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. !! user.ws = function(number,trait,description) {
  2. var rollstring = number + "d6";
  3. var hits = 0;
  4. var output = roll(rollstring).tokens[0].rolls.map(
  5. function (item)
  6. {
  7. if (item.keptValue <= trait)
  8. {
  9. hits += 1;
  10. return '**' + item.keptValue + '**';
  11. }
  12. else return '__~~' + item.keptValue + '~~__';
  13. }
  14. ).join(', ');
  15.  
  16. echo("```Rolling " + description +"...```");
  17. echo("\n**Rolls:** (" + output + ")");
  18. echo("\n \n You rolled __**" + rollstring + "**__ for your awesome description and got __**" + hits + "**__ hits!");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment