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

Preventing card plays

I am using cards to track a resource in my game. I've written scripts to manipulate them in the ways that make sense for my game. My problem is that I can't disable the ability for someone to pull the card out of their hand and drop it on the play area. It would be great if I can either disable the ability to play certain cards in my game or be able to detect which player dropped the card so that I can either delete it or return it to their hand as appropriate. The decks I'm drawing from are one card infinite (I need a specific card id for other features to work). In the past I've been able to iterate over players' hands looking for the card id but in this case I can't do that. Is there anything I can do?
1549238236

Edited 1549238376
The Aaron
Roll20 Production Team
API Scripter
Probably what I would do is watch the change in hands, and cards played on the table.&nbsp; If a card is from a deck you don't want them to play from, use the pickUpCard() function to pull it back off the table, and the giveCardToPlayer() function to give it back to the playing player.&nbsp; You can see some examples of the monitoring and reaction stuff in my PeekCards script.&nbsp; The two objects playedCards and cardPlayers and the functions handleGraphicChange and handleHandChange in particular. Card functions documented here:&nbsp; <a href="https://app.roll20.net/forum/post/6223396/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/6223396/slug%7D</a>