Casino skript
# ======================================================# â–â–â–â–â–â–â•— â–â–â–â–â–â•— â–â–â–â–â–â–â–â•—â–â–â•—â–â–â–â•— â–â–â•— â–â–â–â–â–â–â•—# â–â–â•"â•â•â•â•╝â–â–â•"â•â•â–â–â•—â–â–â•"â•â•â•â•╝â–â–â•'â–â–â–â–â•— â–â–â•'â–â–â•"â•â•â•â–â–â•—# â–â–â•' â–â–â–â–â–â–â–â•'â–â–â–â–â–â–â–â•—â–â–â•'â–â–â•"â–â–â•— â–â–â•'â–â–â•' â–â–â•'# â–â–â•' â–â–â•"â•â•â–â–â•'╚â•â•â•â•â–â–â•'â–â–â•'â–â–â•'╚â–â–â•—â–â–â•'â–â–â•' â–â–â•'# ╚â–â–â–â–â–â–â•—â–â–â•' â–â–â•'â–â–â–â–â–â–â–â•'â–â–â•'â–â–â•' ╚â–â–â–â–â•'╚â–â–â–â–â–â–â•"╝# ╚â•â•â•â•â•╝╚â•╝ ╚â•╝╚â•â•â•â•â•â•╝╚â•╝╚â•╝ ╚â•â•â•╝ ╚â•â•â•â•â•╝# CRYSTALFBFT NETWORK â€" CASINO SYSTEM v2.0 (FIXED)# ======================================================options: prefix: &8[&6&lGAMBLE&8] announcement_threshold: 5000000 star_value: 20000000 lottery_ticket_price: 250000 scratch_card_price: 75000 key_item: tripwire hook named "&6&lGamble Key" with lore "&7Use this key in &e/gk", "&7to double your keys or win bonuses!" scratch_item: paper named "&d&lScratch Card" with lore "&7Use &e/scratch &7to reveal your prize!", "&8Purchased from the casino shop." lottery_item: paper named "&b&lLottery Ticket" with lore "&7Use &e/lottery check &7to see the draw!", "&8Good luck, high roller."# ======================================================# ON LOAD â€" INITIALIZE PERSISTENT DATA# ======================================================on load: if {gamble::jackpot} is not set: set {gamble::jackpot} to 1000000 if {gamble::lottery::pot} is not set: set {gamble::lottery::pot} to 0 if {gamble::lottery::ticket_count} is not set: set {gamble::lottery::ticket_count} to 0# ======================================================# HELPER FUNCTIONS# ======================================================# --- SOUND & PARTICLE EFFECTS ---function playCasinoEffect(p: player, t: text): if {_t} is "win": play sound "entity.player.levelup" with volume 1 to {_p} execute console command "particle totem_of_undying %{_p}'s x-coord% %{_p}'s y-coord + 1% %{_p}'s z-coord% 1 1 1 0.1 40" if {_t} is "loss": play sound "entity.lightning_bolt.thunder" with volume 1 to {_p} strike lightning effect at {_p} execute console command "particle large_smoke %{_p}'s x-coord% %{_p}'s y-coord + 1% %{_p}'s z-coord% 0.5 0.5 0.5 0.1 20" if {_t} is "jackpot": play sound "ui.toast.challenge_complete" with volume 1 to {_p} execute console command "particle flame %{_p}'s x-coord% %{_p}'s y-coord + 1% %{_p}'s z-coord% 2 2 2 0.1 100" if {_t} is "scratch": play sound "entity.arrow.hit_player" with volume 1 to {_p} execute console command "particle happy_villager %{_p}'s x-coord% %{_p}'s y-coord + 1% %{_p}'s z-coord% 1 1 1 0.1 25" if {_t} is "daily": play sound "entity.villager.yes" with volume 1 to {_p} execute console command "particle end_rod %{_p}'s x-coord% %{_p}'s y-coord + 1% %{_p}'s z-coord% 0.5 1 0.5 0.05 30" if {_t} is "lottery": play sound "ui.toast.challenge_complete" with volume 1 to {_p} execute console command "particle firework %{_p}'s x-coord% %{_p}'s y-coord + 1% %{_p}'s z-coord% 2 2 2 0.1 80"# --- STAT TRACKING ---function addWin(p: player, amt: number): add 1 to {gamble::stats::%{_p}%::wins} add {_amt} to {gamble::stats::%{_p}%::earned}function addLoss(p: player, amt: number): add 1 to {gamble::stats::%{_p}%::losses} add {_amt} to {gamble::stats::%{_p}%::lost}# --- SLOT SYMBOL DISPLAY ---function slotSymbol(n: integer) :: text: if {_n} is 1: return "&c❤ CHERRY " if {_n} is 2: return "&e†LEMON " if {_n} is 3: return "&6✦ ORANGE " if {_n} is 4: return "&5â… GRAPE " if {_n} is 5: return "&f✯ STAR " if {_n} is 6: return "&bâ— DIAMOND" if {_n} is 7: return "&4â–˛ SEVEN " return "&7? MYSTERY"# --- SLOT PAYOUT MULTIPLIER ---function slotPayout(a: integer, b: integer, c: integer) :: number: if {_a} is 7 and {_b} is 7 and {_c} is 7: return -1 if {_a} is {_b} and {_b} is {_c}: if {_a} is 6: return 10 if {_a} is 5: return 5 if {_a} is 4: return 3.5 if {_a} is 3: return 3 if {_a} is 2: return 2.5 if {_a} is 1: return 2 if {_a} is {_b} or {_b} is {_c} or {_a} is {_c}: return 0.75 return 0# --- SCRATCH CARD LABEL ---# FIX: Was incorrectly nested inside /scratch command. Functions must be top-level.function scratchLabel(n: integer) :: text: if {_n} <= 3: return "&7[ &f100K &7]" if {_n} <= 5: return "&7[ &e250K &7]" if {_n} is 6: return "&7[ &a500K &7]" if {_n} is 7: return "&7[ &61M &7]" if {_n} is 8: return "&7[ &b KEY &7]" if {_n} is 9: return "&7[ &dSTAR &7]" if {_n} is 10: return "&7[ &4 7 &7]" return "&7[ &7??? &7]"# ======================================================# /gamble â€" MAIN HUB MENU# ======================================================command /gamble: trigger: send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &6&lâ… CRYSTALFBFT CASINO â…" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send "" to player send " &f&lMONEY GAMES" to player send " &8â" &e/cf <amount> &7Coinflip â€" 50/50" to player send " &8â" &e/slots <amount> &7Slot Machine â€" 3 reels" to player send " &8â" &e/roulette &7Roulette â€" pick your odds" to player send "" to player send " &f&lITEM GAMES" to player send " &8â" &6/gk &7Gamble Key spin" to player send " &8â" &d/scratch &7Scratch card reveal" to player send " &8â" &b/lottery buy &7Lottery â€" &e%{gamble::lottery::ticket_count}% tickets sold" to player send "" to player send " &f&lFREE" to player send " &8â" &a/daily &7Daily reward (24h cooldown)" to player send "" to player send " &f&lSHOP & TRADE" to player send " &8â" &7/buyscratch &7Buy Scratch Card &8(&e%{@scratch_card_price}%amp;8)" to player send " &8â" &7/tradestar &7Star â†' 25 Gamble Keys" to player send " &8â" &7/sellstar &7Star â†' &a20,000,000$" to player send "" to player send " &8â" &7/stats &7Your gambling statistics" to player send " &8â" &7/leaderboard &7Top earners" to player send "" to player send " &8â"Śâ"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send " &8â"' &6&l⚡ JACKPOT: &a&l%{gamble::jackpot}%$" to player send " &8â"' &b&l🎟 LOTTERY: &a&l%{gamble::lottery::pot}%$ &7pot" to player send " &8â""â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send "" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player# ======================================================# /cf â€" COINFLIP# ======================================================command /coinflip <number>: usage: &6Usage: &e/cf [amount] aliases: /cf trigger: if arg-1 is not set: send "{@prefix} &6Usage: &e/cf <amount>" to player stop if player's balance < arg-1: send "{@prefix} &cInsufficient funds! &7You need &e%arg-1%amp;c." to player stop if arg-1 < 100: send "{@prefix} &cMinimum bet is &e100amp;c!" to player stop remove arg-1 from player's balance send "" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &6&l⚡ COIN FLIP ⚡" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &7Flipping coin for &e%arg-1%amp;7..." to player loop 3 times: play sound "block.note_block.bit" with volume 1 to player wait 0.5 seconds if chance of 50%: set {_payout} to arg-1 * 2 add {_payout} to player's balance addWin(player, arg-1) playCasinoEffect(player, "win") send " &8â"Śâ"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send " &8â"' &a&lâś" YOU WIN!" to player send " &8â"' &7Payout: &a+%{_payout}%$" to player send " &8â""â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player if chance of 3%: set {_jpw} to {gamble::jackpot} add {_jpw} to player's balance set {gamble::jackpot} to 1000000 playCasinoEffect(player, "jackpot") broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" broadcast " &4&lâ… JACKPOT â…" broadcast " &e%player% &7hit the &6&lCOINFLIP JACKPOT!" broadcast " &7Reward: &a&l%{_jpw}%$" broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" else: if arg-1 >= {@announcement_threshold}: broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" broadcast " &6&l⚡ BIG CF WIN! &e%player% &7won &a&l%{_payout}%$!" broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" if chance of 10%: set {_loot} to random integer between 1 and 5 if {_loot} is 1: give 1 nether star named "&6&lCasino Star" with lore "&7Value: 20,000,000$" to player send " &b&lBONUS LOOT: &fCasino Star &7(20M)!" to player else if {_loot} is 2: give 1 stick named "&b&lYEETER 3000" enchanted with knockback 10 to player send " &b&lBONUS LOOT: &fYeeter 3000!" to player else if {_loot} is 3: give 1 enchanted golden apple named "&c&lGOD FRUIT" to player send " &b&lBONUS LOOT: &fGod Fruit!" to player else if {_loot} is 4: give 1 diamond pickaxe named "&3&lMINER'S DREAM" enchanted with efficiency 10 to player send " &b&lBONUS LOOT: &fMiner's Dream Pickaxe!" to player else if {_loot} is 5: give 1 golden helmet named "&e&lCASINO CROWN" enchanted with protection 5 to player send " &b&lBONUS LOOT: &fCasino Crown!" to player else: addLoss(player, arg-1) playCasinoEffect(player, "loss") set {_pot} to arg-1 * 0.05 add {_pot} to {gamble::jackpot} send " &8â"Śâ"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send " &8â"' &c&lâś YOU LOSE!" to player send " &8â"' &7Lost: &c-%arg-1%$" to player send " &8â""â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send "" to player# ======================================================# /gk â€" GAMBLE KEY# ======================================================command /gamblekey: aliases: /gk trigger: if player has 1 of {@key_item}: remove 1 of {@key_item} from player's inventory add 100 to {gamble::jackpot} send "" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &6&lđź—ť GAMBLE KEY SPIN" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &7Inserting &eGamble Key&7 into the machine..." to player send " &8(+100$ contributed to Jackpot)" to player loop 3 times: play sound "block.note_block.bit" with volume 1 to player wait 0.5 seconds if chance of 50%: give 2 of {@key_item} to player addWin(player, 0) playCasinoEffect(player, "win") send " &8â"Śâ"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send " &8â"' &a&lâś" KEY WIN!" to player send " &8â"' &7Reward: &e+2x Gamble Keys" to player send " &8â""â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player broadcast "{@prefix} &e%player% &7won &e2 Gamble Keys &7in a key spin!" if chance of 20%: set {_keyloot} to random integer between 1 and 7 if {_keyloot} is 1: give 1 nether star named "&6&lCasino Star" with lore "&7Value: 20,000,000$" to player send " &b&lâ… BONUS: &fCasino Star &a(20,000,000$)&7!" to player broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" broadcast " &b&lBONUS WIN! &e%player% &7got a &fCasino Star &afrom a Key!" broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" else if {_keyloot} is 2: give 1 stick named "&b&lYEETER 3000" enchanted with knockback 10 to player send " &b&lâ… BONUS: &fYeeter 3000!" to player else if {_keyloot} is 3: give 1 enchanted golden apple named "&c&lGOD FRUIT" to player send " &b&lâ… BONUS: &fGod Fruit!" to player else if {_keyloot} is 4: give 1 diamond pickaxe named "&3&lMINER'S DREAM" enchanted with efficiency 10 to player send " &b&lâ… BONUS: &fMiner's Dream Pickaxe!" to player else if {_keyloot} is 5: give 1 golden helmet named "&e&lCASINO CROWN" to player send " &b&lâ… BONUS: &fCasino Crown!" to player else if {_keyloot} is 6: set {_m} to random integer between 100000 and 500000 add {_m} to player's balance send " &e&lâ… CASH BONUS: &a+%{_m}%amp;7!" to player else if {_keyloot} is 7: set {_m} to random integer between 500000 and 1000000 add {_m} to player's balance send " &6&lâ… HUGE CASH: &a+%{_m}%amp;7!" to player broadcast "{@prefix} &e%player% &7found &a%{_m}%$ &7inside a &6Gamble Key&7!" else: addLoss(player, 0) playCasinoEffect(player, "loss") add 500000 to {gamble::jackpot} send " &8â"Śâ"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send " &8â"' &c&lâś KEY CONSUMED!" to player send " &8â"' &7The machine ate your key." to player send " &8â""â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send "" to player else: send "{@prefix} &cYou don't have a &eGamble Key&c! Use &e/buyscratch &cor win one." to player# ======================================================# /slots â€" SLOT MACHINE# ======================================================command /slots <number>: aliases: /slot usage: &6Usage: &e/slots [amount] trigger: if arg-1 is not set: send "{@prefix} &6Usage: &e/slots <amount> &7| Min: &e500$ &7| Max: &e10,000,000$" to player stop if player's balance < arg-1: send "{@prefix} &cInsufficient funds! You need &e%arg-1%amp;c." to player stop if arg-1 < 500: send "{@prefix} &cMinimum slot bet is &e500amp;c!" to player stop if arg-1 > 10000000: send "{@prefix} &cMaximum slot bet is &e10,000,000amp;c!" to player stop remove arg-1 from player's balance add (arg-1 * 0.03) to {gamble::jackpot} send "" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &6&l🎰 SLOT MACHINE 🎰" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &7Spinning for &e%arg-1%amp;7..." to player play sound "block.note_block.bit" with volume 1 to player wait 0.35 seconds play sound "block.note_block.bit" with volume 1 to player wait 0.35 seconds play sound "block.note_block.hat" with volume 1.5 to player wait 0.35 seconds set {_r1} to random integer between 1 and 7 set {_r2} to random integer between 1 and 7 set {_r3} to random integer between 1 and 7 set {_mult} to slotPayout({_r1}, {_r2}, {_r3}) send "" to player send " &8â"Śâ"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send " &8â"' %slotSymbol({_r1})% &8â"'" to player send " &8â"' %slotSymbol({_r2})% &8â"'" to player send " &8â"' %slotSymbol({_r3})% &8â"'" to player send " &8â""â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send "" to player if {_mult} is -1: set {_jpw} to {gamble::jackpot} set {_bonus} to arg-1 * 20 add {_jpw} to player's balance add {_bonus} to player's balance set {gamble::jackpot} to 1000000 addWin(player, {_jpw}) playCasinoEffect(player, "jackpot") send " &4&lâ…â…â… T R I P L E 7 7 7 â…â…â…" to player send " &6&lJACKPOT: &a+%{_jpw}%$ &7+ &a+%{_bonus}%$ bonus" to player broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" broadcast " &4&lâ… SLOTS JACKPOT â…" broadcast " &e%player% &7hit &4&lTRIPLE 777 &7on the Slot Machine!" broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player stop if {_mult} > 0: set {_win} to arg-1 * {_mult} add {_win} to player's balance addWin(player, {_win}) playCasinoEffect(player, "win") if {_mult} >= 5: send " &b&lâ— MEGA WIN! &a+%{_win}%$ &8(%{_mult}%x)" to player broadcast "{@prefix} &e%player% &7hit a &b&lMEGA WIN &7on slots! &a(%{_win}%$)" else if {_mult} >= 2: send " &a&lâś" WIN! &7You won &a+%{_win}%$ &8(%{_mult}%x)" to player else: send " &2â†' Small win. &7Got back &a%{_win}%$ &8(0.75x)" to player else: addLoss(player, arg-1) playCasinoEffect(player, "loss") send " &c&lâś No match. &7Better luck next spin!" to player send "" to player send " &7&oPAYTABLE: 2x Cherry/Lemon · 3x Orange/Grape · 5x Star · 10x Diamond · JACKPOT on 777" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send "" to player# ======================================================# /roulette â€" ROULETTE WHEEL# Usage: /roulette <red|black|green|0-36> <amount># ======================================================command /roulette <text> <number>: aliases: /rl usage: &6Usage: &e/roulette <red|black|green|0-36> <amount> trigger: if arg-1 is not set or arg-2 is not set: send "" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &6&l🎡 ROULETTE GUIDE" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &f/roulette red <amount> &7â†' &a2x payout" to player send " &f/roulette black <amount> &7â†' &a2x payout" to player send " &f/roulette green <amount> &7â†' &a14x payout &8(0 only)" to player send " &f/roulette <0-36> <amount> &7â†' &a36x payout" to player send "" to player send " &7Minimum: &e1,000$ &7| Maximum: &e50,000,000$" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player stop if player's balance < arg-2: send "{@prefix} &cInsufficient funds!" to player stop if arg-2 < 1000: send "{@prefix} &cMinimum roulette bet is &e1,000amp;c!" to player stop if arg-2 > 50000000: send "{@prefix} &cMaximum roulette bet is &e50,000,000amp;c!" to player stop set {_bet} to arg-1 in lowercase if {_bet} is not "red" and {_bet} is not "black" and {_bet} is not "green": if arg-1 is not an integer: send "{@prefix} &cInvalid bet! Use &ered&c, &7black&c, &agreen&c, or a &enumber 0-36&c." to player stop if arg-1 < 0 or arg-1 > 36: send "{@prefix} &cNumber must be between &e0 &cand &e36&c!" to player stop remove arg-2 from player's balance add (arg-2 * 0.02) to {gamble::jackpot} send "" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &6&l🎡 ROULETTE WHEEL" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player play sound "block.note_block.bass" with volume 1 to player wait 0.3 seconds play sound "block.note_block.bass" with volume 1 to player wait 0.3 seconds play sound "block.note_block.pling" with volume 1 to player wait 0.5 seconds set {_spin} to random integer between 0 and 36 if {_spin} is 0: set {_color} to "green" set {_display} to "&a&l[ 0 â€" GREEN ]" else: set {_odd} to {_spin} mod 2 if {_odd} is 1: set {_color} to "red" set {_display} to "&c&l[ %{_spin}% â€" RED ]" else: set {_color} to "black" set {_display} to "&8&l[ %{_spin}% â€" BLACK ]" send "" to player send " &7Ball landed on: %{_display}%" to player send "" to player set {_won} to false if {_bet} is "red": if {_color} is "red": set {_won} to true set {_payout} to arg-2 * 2 set {_multi_text} to "&72x" if {_bet} is "black": if {_color} is "black": set {_won} to true set {_payout} to arg-2 * 2 set {_multi_text} to "&72x" if {_bet} is "green": if {_color} is "green": set {_won} to true set {_payout} to arg-2 * 14 set {_multi_text} to "&614x" # FIX: Check numeric bet separately to avoid "else if" chain issues if {_won} is false: if arg-1 is an integer: if arg-1 is {_spin}: set {_won} to true set {_payout} to arg-2 * 36 set {_multi_text} to "&436x &lâ…" if {_won} is true: add {_payout} to player's balance addWin(player, {_payout}) playCasinoEffect(player, "win") send " &8â"Śâ"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send " &8â"' &a&lâś" CORRECT CALL!" to player send " &8â"' &7Payout: &a+%{_payout}%$ &8(%{_multi_text}&8)" to player send " &8â""â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player if {_payout} >= {@announcement_threshold}: broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" broadcast " &6&l🎡 ROULETTE WIN! &e%player% &7called &f%arg-1% &7and won &a%{_payout}%$!" broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" else: addLoss(player, arg-2) playCasinoEffect(player, "loss") send " &8â"Śâ"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send " &8â"' &c&lâś WRONG CALL!" to player send " &8â"' &7Lost: &c-%arg-2%$" to player send " &8â""â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send "" to player# ======================================================# /buyscratch â€" BUY A SCRATCH CARD# ======================================================command /buyscratch: trigger: if player's balance < {@scratch_card_price}: send "{@prefix} &cYou need &e%{@scratch_card_price}%$ &cto buy a Scratch Card!" to player stop remove {@scratch_card_price} from player's balance give 1 of {@scratch_item} to player send "{@prefix} &dScratch Card purchased for &e%{@scratch_card_price}%amp;7!" to player send "{@prefix} &7Use &e/scratch &7to reveal your prize." to player play sound "entity.item.pickup" with volume 1 to player# ======================================================# /scratch â€" SCRATCH CARD REVEAL# ======================================================command /scratch: trigger: if player has 1 of {@scratch_item}: remove 1 of {@scratch_item} from player's inventory send "" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &d&l✦ SCRATCH CARD ✦" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &7Scratching your card..." to player play sound "block.gravel.break" with volume 1 to player wait 0.3 seconds play sound "block.gravel.break" with volume 1 to player wait 0.3 seconds play sound "block.gravel.break" with volume 1 to player wait 0.5 seconds set {_s1} to random integer between 1 and 10 set {_s2} to random integer between 1 and 10 set {_s3} to random integer between 1 and 10 send "" to player send " &8â"Śâ"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send " &8â"' %scratchLabel({_s1})% %scratchLabel({_s2})% %scratchLabel({_s3})% &8â"'" to player send " &8â""â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"€â"" to player send "" to player if {_s1} is {_s2} and {_s2} is {_s3}: if {_s1} is 10: set {_jpw} to {gamble::jackpot} add {_jpw} to player's balance set {gamble::jackpot} to 1000000 addWin(player, {_jpw}) playCasinoEffect(player, "jackpot") send " &4&lâ… TRIPLE 7! SCRATCH JACKPOT! â…" to player send " &6&lWon: &a&l%{_jpw}%$!" to player broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" broadcast " &4&lâ… SCRATCH JACKPOT! &e%player% &7won &a%{_jpw}%$!" broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" else if {_s1} is 9: give 3 nether star named "&6&lCasino Star" with lore "&7Value: 20,000,000$" to player addWin(player, 0) playCasinoEffect(player, "win") send " &d&lâ… TRIPLE STAR! &73x Casino Stars!" to player broadcast "{@prefix} &e%player% &7scratched &d&lTRIPLE STARS &7on a Scratch Card! 🌟" else if {_s1} is 8: give 5 of {@key_item} to player playCasinoEffect(player, "win") send " &b&lâ… TRIPLE KEY! &7Won &e5 Gamble Keys&7!" to player else if {_s1} is 7: add 3000000 to player's balance addWin(player, 3000000) playCasinoEffect(player, "win") send " &6&lâ… TRIPLE 1M! &aWon 3,000,000$!" to player else if {_s1} is 6: add 1500000 to player's balance addWin(player, 1500000) playCasinoEffect(player, "win") send " &a&lâ… TRIPLE 500K! &aWon 1,500,000$!" to player else if {_s1} is 5: add 750000 to player's balance addWin(player, 750000) playCasinoEffect(player, "win") send " &e&lâ… TRIPLE 250K! &aWon 750,000$!" to player else: add 300000 to player's balance addWin(player, 300000) playCasinoEffect(player, "win") send " &f&lâ… TRIPLE 100K! &aWon 300,000$!" to player playCasinoEffect(player, "scratch") else if {_s1} is {_s2} or {_s2} is {_s3} or {_s1} is {_s3}: add 50000 to player's balance addWin(player, 50000) playCasinoEffect(player, "scratch") send " &2âś" Double match! &aWon 50,000amp;7." to player else: addLoss(player, 0) send " &câś No match. &7Try again!" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send "" to player else: send "{@prefix} &cYou don't have a &dScratch Card&c! Buy one with &e/buyscratch&c." to player# ======================================================# /daily â€" DAILY REWARD# FIX: Was using {_key} (local string var) to reference persistent storage.# Now correctly reads/writes {gamble::daily::%player%} directly.# ======================================================command /daily: trigger: if {gamble::daily::%player%} is set: set {_diff} to difference between {gamble::daily::%player%} and now if {_diff} < 24 hours: set {_remaining} to 24 hours - {_diff} send "" to player send "{@prefix} &cYou already claimed today's reward!" to player send "{@prefix} &7Come back in &e%{_remaining}%&7." to player send "" to player stop set {gamble::daily::%player%} to now set {_tier} to random integer between 1 and 100 send "" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &a&l🎠DAILY REWARD" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player playCasinoEffect(player, "daily") if {_tier} <= 50: set {_cash} to random integer between 50000 and 200000 add {_cash} to player's balance send " &fâ—† Common Reward:" to player send " &7Cash: &a+%{_cash}%$" to player else if {_tier} <= 75: set {_cash} to random integer between 200000 and 500000 set {_keys} to random integer between 1 and 2 add {_cash} to player's balance give {_keys} of {@key_item} to player send " &aâ—† Uncommon Reward:" to player send " &7Cash: &a+%{_cash}%$ &8+ &e%{_keys}%x Gamble Key" to player else if {_tier} <= 90: set {_cash} to random integer between 500000 and 1000000 add {_cash} to player's balance send " &9â—† Rare Reward:" to player send " &7Cash: &a+%{_cash}%$" to player else if {_tier} <= 97: give 3 of {@key_item} to player give 1 of {@scratch_item} to player send " &5â—† Epic Reward:" to player send " &e3x Gamble Keys &8+ &dScratch Card" to player broadcast "{@prefix} &e%player% &7got an &5&lEpic Daily Reward&7!" else: give 1 nether star named "&6&lCasino Star" with lore "&7Value: 20,000,000$" to player send " &6â—† &6&lLEGENDARY REWARD:" to player send " &f&lCasino Star &7(&a20,000,000amp;7)!" to player broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" broadcast " &6&lâ… LEGENDARY DAILY! &e%player% &7won a &fCasino Star &7from /daily!" broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" send "" to player send " &7Come back in &e24 hours &7for your next reward!" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send "" to player# ======================================================# /lottery â€" LOTTERY SYSTEM# FIX: Track ticket holders in a list variable {gamble::lottery::holders::*}# instead of relying on per-player boolean flags and broken "all players where" filter.# ======================================================command /lottery <text>: trigger: if arg-1 is "buy": if player's balance < {@lottery_ticket_price}: send "{@prefix} &cYou need &e%{@lottery_ticket_price}%$ &cto buy a lottery ticket!" to player stop remove {@lottery_ticket_price} from player's balance add 1 to {gamble::lottery::ticket_count} add {@lottery_ticket_price} to {gamble::lottery::pot} # FIX: Add player's name to the holders list for reliable draw access add "%player%" to {gamble::lottery::holders::*} give 1 of {@lottery_item} to player send "" to player send "{@prefix} &bLottery ticket purchased for &e%{@lottery_ticket_price}%amp;7!" to player send "{@prefix} &7Pot is now: &a%{gamble::lottery::pot}%$ &7| &e%{gamble::lottery::ticket_count}% &7total tickets." to player send "{@prefix} &7An admin will run &e/lottery draw &7to pick the winner!" to player send "" to player broadcast "{@prefix} &e%player% &7bought a &bLottery Ticket&7! Pot: &a%{gamble::lottery::pot}%$" else if arg-1 is "info": send "" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &b&l🎟 LOTTERY INFO" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &7Current Pot: &a&l%{gamble::lottery::pot}%$" to player send " &7Tickets Sold: &e%{gamble::lottery::ticket_count}%" to player send " &7Ticket Price: &e%{@lottery_ticket_price}%$" to player # FIX: Replaced broken ternary operator with proper if/else if "%player%" is in {gamble::lottery::holders::*}: send " &7Your Ticket: &aYES" to player else: send " &7Your Ticket: &cNO" to player send "" to player send " &7Use &e/lottery buy &7to enter!" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send "" to player else if arg-1 is "draw": if player doesn't have permission "network.admin.dupe": send "{@prefix} &cYou don't have permission to draw the lottery!" to player stop if {gamble::lottery::ticket_count} < 2: send "{@prefix} &cNeed at least &e2 tickets sold &cto draw!" to player stop if {gamble::lottery::holders::*} is not set: send "{@prefix} &cNo valid ticket holders found!" to player stop # FIX: Pick winner from the holders list directly set {_winner} to random element out of {gamble::lottery::holders::*} set {_prize} to {gamble::lottery::pot} set {_winnerPlayer} to {_winner} parsed as offline player add {_prize} to balance of {_winnerPlayer} if {_winnerPlayer} is online: playCasinoEffect({_winnerPlayer}, "lottery") broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" broadcast " &b&l🎟 L O T T E R Y D R A W 🎟" broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" broadcast " &7Winner: &e&l%{_winner}%" broadcast " &7Prize: &a&l%{_prize}%$" broadcast " &7Tickets sold: &e%{gamble::lottery::ticket_count}%" broadcast "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" # RESET clear {gamble::lottery::holders::*} set {gamble::lottery::pot} to 0 set {gamble::lottery::ticket_count} to 0 send "{@prefix} &aLottery drawn! Winner: &e%{_winner}%&a. Pot reset." to player else: send "{@prefix} &6Usage: &e/lottery <buy|info|draw>" to player# ======================================================# /stats â€" PERSONAL GAMBLING STATS# FIX: Replaced invalid inline ternary "if X is set else Y" with proper if/else blocks.# ======================================================command /stats [<offline player>]: trigger: # FIX: Use proper if/else instead of inline ternary assignment if arg-1 is set: set {_target} to "%arg-1%" else: set {_target} to "%player%" if {gamble::stats::%{_target}%::wins} is set: set {_wins} to {gamble::stats::%{_target}%::wins} else: set {_wins} to 0 if {gamble::stats::%{_target}%::losses} is set: set {_losses} to {gamble::stats::%{_target}%::losses} else: set {_losses} to 0 if {gamble::stats::%{_target}%::earned} is set: set {_earned} to {gamble::stats::%{_target}%::earned} else: set {_earned} to 0 if {gamble::stats::%{_target}%::lost} is set: set {_lost} to {gamble::stats::%{_target}%::lost} else: set {_lost} to 0 set {_total} to {_wins} + {_losses} set {_net} to {_earned} - {_lost} send "" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &6&lđź"Š STATS â€" &e%{_target}%" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &7Total Games: &f%{_total}%" to player send " &7Wins: &a%{_wins}%" to player send " &7Losses: &c%{_losses}%" to player send " &7Total Earned: &a+%{_earned}%$" to player send " &7Total Lost: &c-%{_lost}%$" to player if {_net} >= 0: send " &7Net Profit: &a+%{_net}%$" to player else: send " &7Net Profit: &c%{_net}%$" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send "" to player# ======================================================# /leaderboard â€" TOP EARNERS# FIX: Replaced broken "? 0" ternary with proper if/else for earnings lookup.# Note: Skript cannot sort persistent variables without SkQuery. This shows# online players only. For a full sorted board, use SkQuery or store a# sorted list on win events.# ======================================================command /leaderboard: aliases: /lb trigger: send "" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &6&l🏆 CASINO LEADERBOARD" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send " &7(Top earners â€" online players)" to player send "" to player set {_rank} to 0 loop all players: add 1 to {_rank} if {_rank} > 10: stop loop # FIX: Replaced broken ternary "? 0" with proper if/else if {gamble::stats::%loop-player%::earned} is set: set {_e} to {gamble::stats::%loop-player%::earned} else: set {_e} to 0 if {_rank} is 1: send " &6&l#1 &e%loop-player% &7â€" &a%{_e}%$ earned" to player else if {_rank} is 2: send " &7&l#2 &f%loop-player% &7â€" &a%{_e}%$ earned" to player else if {_rank} is 3: send " &6#3 &f%loop-player% &7â€" &a%{_e}%$ earned" to player else: send " &8#%{_rank}% &7%loop-player% â€" &a%{_e}%$" to player send "" to player send " &7Jackpot: &a%{gamble::jackpot}%$" to player send "&8&mâ"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"â"" to player send "" to player# ======================================================# /sellstar â€" SELL CASINO STAR# ======================================================command /sellstar: trigger: if player has 1 nether star named "&6&lCasino Star": remove 1 nether star named "&6&lCasino Star" from player's inventory add {@star_value} to player's balance send "{@prefix} &aSold Casino Star for &e20,000,000amp;a!" to player play sound "entity.experience_orb.pickup" with volume 1 to player else: send "{@prefix} &cYou don't have a &6&lCasino Star &cto sell!" to player# ======================================================# /tradestar â€" STAR â†' 25 KEYS# ======================================================command /tradestar: trigger: if player has 1 nether star named "&6&lCasino Star": remove 1 nether star named "&6&lCasino Star" from player's inventory give 25 of {@key_item} to player send "{@prefix} &aTraded Casino Star for &e25 Gamble Keys&a!" to player broadcast "{@prefix} &e%player% &7traded a &fCasino Star &7for &e25 Gamble Keys! &6&lBIG MOVES!" play sound "entity.item.pickup" with volume 1 to player else: send "{@prefix} &cYou don't have a &6&lCasino Star &cto trade!" to player# ======================================================# PASSIVE â€" MINING BONUS# ======================================================on mine of diamond ore or emerald ore: if chance of 0.5%: give 1 of {@key_item} to player send "{@prefix} &b&lLUCKY! &7Found a &eGamble Key &7while mining!" to player broadcast "{@prefix} &e%player% &7found a &6Gamble Key &7while mining! &b&lGG!" play sound "block.enchantment_table.use" with volume 1 to player# ======================================================# ADMIN COMMANDS# ======================================================command /dupe [<integer>]: permission: network.admin.dupe permission message: &c&lERROR &8» &7You do not have permission. trigger: if player's tool is air: send "&c&lERROR &8» &7You must be holding an item!" to player stop if arg-1 is set: set {_amount} to arg-1 else: set {_amount} to item amount of player's tool set {_item} to player's tool set item amount of {_item} to {_amount} give {_item} to player send "&6&lNETWORK &8» &aDuplicated &e%{_amount}%x %type of player's tool%&a." to playercommand /duplicate [<integer>]: permission: network.admin.dupe trigger: execute player command "/dupe %arg-1%"command /givekey <player> <integer>: permission: network.admin.dupe trigger: give arg-2 of {@key_item} to arg-1 send "{@prefix} &7Gave &e%arg-2%x Gamble Key &7to &e%arg-1%&7." to playercommand /givescratch <player> [<integer>]: permission: network.admin.dupe trigger: if arg-2 is set: set {_amt} to arg-2 else: set {_amt} to 1 give {_amt} of {@scratch_item} to arg-1 send "{@prefix} &7Gave &d%{_amt}%x Scratch Card &7to &e%arg-1%&7." to playercommand /setjackpot <number>: permission: network.admin.dupe trigger: set {gamble::jackpot} to arg-1 send "{@prefix} &aJackpot set to &e%arg-1%amp;a." to player# ======================================================# END OF CRYSTALFBFT CASINO v2.0 (FIXED)# ======================================================