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

Player Handouts don't work after using this script

<a href="https://app.roll20.net/forum/post/9392616/deleting-all-handouts-from-player-journals#newtopic" rel="nofollow">https://app.roll20.net/forum/post/9392616/deleting-all-handouts-from-player-journals#newtopic</a> I used this script from the post above to remove all player handouts but now I have new players that I want to show these handouts too and I can't. I can show the tokens though. :(&nbsp; on('ready', () =&gt; { log(`removeHandout bot is ready...`); on('chat:message', (msg) =&gt; { if (msg.type === 'api' &amp;&amp; msg.content.search(/^!handoutRemove/) !== -1) { try { let counter=0; handoutArray = _.map(findObjs({type: 'handout'}),c =&gt; c.get('_id')); log(`${handoutArray.length} handouts found...`) handoutArray.forEach(entry =&gt; { getObj('handout',entry).set('inplayerjournals', ' '); log(`${getObj('handout',entry).get('name')} removed from players' Journals...`); counter ++; }); sendChat('handoutBot',`${counter} handouts processed.`) } catch { log(`Something went wrong, no handouts in array.`); } } else {return} }) })
1690072059
The Aaron
Roll20 Production Team
API Scripter
When you say you can't show the handouts, but you can show the tokens, what tokens are you referring to, and how does showing fail?&nbsp; One thing I notice is the script is setting the inplayerjournals to ' ' (a space) instead of '' (an empty string).&nbsp; I don't know if that makes a difference, but you could try this version and see if it works: on('ready', () =&gt; { log(`removeHandout bot is ready...`); on('chat:message', (msg) =&gt; { if (msg.type === 'api' &amp;&amp; /^!handoutRemove/i.test(msg.content) ) { let counter=0; let handoutArray = findObjs({type: 'handout'}); log(`${handoutArray.length} handouts found...`); const burndown = () =&gt; { let h = handoutArray.shift(); if(h){ h.set('inplayerjournals',''); log(`${h.get('name')} removed from players' Journals...`); counter++; setTimeout(burndown,0); } else { sendChat('handoutBot',`${counter} handouts processed.`); } }; burndown(); } }); });
1690072484

Edited 1690072505
When I click show to players there is usually a popup that says "not visible to players" and gives you a chance to cancel. When I say tokens I referred to all the monsters that can be dragged unto the map. The original API seems to permanently take away any showed handouts/tokens/art. But anything I haven't shown already still works. (I'm testing out your API right now)
Your version fixed everything, t hank you so much I wish I had reach out to you earlier because this was honestly wearing me down.&nbsp;
1690075326
The Aaron
Roll20 Production Team
API Scripter
No problem! Glad you got it working!