Tabletop Simulator

Tabletop Simulator

Not enough ratings
Universal Blackjack Card Counter
   
Award
Favorite
Favorited
Unfavorite
Game Category: Card Games
Assets: Scripting
Tags: Misc
File Size
Posted
58.015 KB
1 Oct, 2016 @ 7:53pm
1 Change Note ( view )

Subscribe to download
Universal Blackjack Card Counter

Description
This is a script that counts the value of cards for blackjack, displaying each player's (and the dealer's) hand value. It is made in such a way so that anyone, even someone who has no idea how Lua works, should be able to get it to work on their own blackjack table. VERY detailed instructions on how to do so are included.

Features:
  • Counts Only Face Up Cards: Face-down cards, like the dealer's, do not display on the counter.
  • Color Coded Counters: Counters are black, unless you hit 21, then it will turn green. If you bust, it will turn red. The dealer's counter does this too, but also turns yellow on 17-20.
  • Automatic Blackjack Check: When the dealer has 1 face-down card and 1 face-up card, the script will automatically check if the dealer has blackjack. If they do, it announces it to everyone and flips over the dealer's face-down card.
  • Error Protection: This counter will not spam errors if you hit Undo. Hitting undo DOES cause a single timer error for the host, but the script will still be working at 100%.
  • Counts Cards That Are Accidently Stacked: As long as the stacked cards are face up, the tool will still display their count.
  • Low Impact: I designed this code to have as little impact on load time/performance as possible.
  • Commented Code: For scripters, I commented out the code to explain what each step is doing.

If anyone does use this script on their table, I do appreciate a credit for it somewhere. But that is exactly what this script is for. I hope you enjoy.

If you follow the instructions closely, but are still having trouble, put your code into a pastebin ( pastebin.com ) and post a comment for help.





5 Comments
Kagenokami 31 Oct, 2016 @ 7:09pm 
*Has swirly eyes* So...confused. Sadly though I have attempted to learn scripting many times, I have so far failed. XD But I can at least understand the basic problem despite not understanding your solution. It is fine the way it is. Was merely curious is all :) Thank you so much for the response! ^.^
MrStump  [author] 31 Oct, 2016 @ 6:40pm 
The issue is that it checks for blackjack constantly, so there is no simple way. If you know scripting, you could add a bool variable which triggers when it is checking that there are 2 cards for blackjack and that the bool is false. Then set the bool to true so it is only checking once. Then have the "deal" button reset the bool to false again to allow that bit of code to run again.
Kagenokami 31 Oct, 2016 @ 4:37pm 
Omg this is great! One question though, how would I add in a function to make the counter broadcast that the dealer does NOT have blackjack if the checker finds that the dealer does not in fact have blackjack?
Corsaka 16 Oct, 2016 @ 3:37am 
THANKS SO MUCH
lelelelelelelelelelelelelelele 3 Oct, 2016 @ 3:29am 
As always, an extremely useful little script by MrStump.
Usable in various situations, not only BlackJack!
Thanks a lot, MrStump! :)