• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Blackjack Minigame

Bintzer

One Love
Joined
Dec 19, 2007
Messages
1,763
Reaction score
30
Location
Orlando
Well I haven't contributed anything in too long so here's a little something I hope you like.

blackjack2.png


If you want to change the table/levers layout all you need to change is the variables at the top of the blackjack.lua movement file.
The maximum amount a player can bet can be changed from the bet.lua movement file.


You can't play the house so you'll need at least 2 people to play but there is no limit on the number of players.

How to Play:
  1. Step on the tile (pictured above as the grey tile) to activate the betting mechanism.
  2. Once activated all players will have 20 seconds to place their bet. Each player must call the initial bet to join (cannot raise) by throwing their gold in the fire. The current bet is displayed over the fire. The maximum amount of gold the initial bet allows can be changed (see above).
  3. After 20 seconds each player will be dealt two cards, the first one being hidden to everyone but yourself. Your cards will be displayed at the bottom of your screen.
  4. The goal is to keep getting more cards (hitting) in order to get as close as possible to a score of 21 without going over or you will "bust". You must pull the "stay" lever if you do not want any more cards.
  5. After everyone has either "stayed" or "busted" the person with the highest score less than or equal to 21 gets all the money bet by each player. If there is more than one winner the gold is split evenly.

Face cards
(Jacks, Queens and Kings) are worth 10 points. Aces are worth 1 or 11, whichever is preferable. Other cards are represented by their number.



It is far from optimal (as far as the code goes) but its working perfectly without bugs on 0.4.

I'm assuming anyone with a little sense can implement this themselves so here it is: View attachment blackjack.zip
I'll update this post with updates/improvements and, if enough people can't figure it out, how to implement it.

If you just want to play come check out https://tntopentibia.com. The table is located on the floor below where you first spawn, along with a high-low dice machine.
 
Very interesting! Great contribution, seems flawless.
 
Awesome :) Would be cool to do this through an NPC though! A dealer, everyone talk with the dealer in priv and he run the game and let the players know what goes on. Could also be cool :)
 
Wish it was 0.3.7 compatible.. lol... But if you were to upgrade (really only need to change the dosendanimatedtext's), id want a npc dealer, that would be cool!!
 
im not continuing to develop this. if you want to expand it feel free, im not stopping you.
 
How install this? Someone can help me?
Whats the action and movement tags? And de lib....
 
Back
Top