#CrashGame by XxMichal10390xX #Wersja: 1.3 command /bet [] []: trigger: if arg 1 is not set: send "&6/bet &7- &2Wpisz aby dolaczyc do nastepnej rundy" if arg 1 = 0: if arg 2 is "auto": set {_autobet} to yaml value "auto.bet" from file "plugins/CrashGame/players/%player%.yml" if {_autobet} parsed as boolean is false: send "&7[&2CRASH&7] &cNie mozesz ustawic Auto-Bet na &6$0" to player stop if {_autobet} parsed as boolean is true: set yaml value "auto.bet" from file "plugins/CrashGame/players/%player%.yml" to "false" set yaml value "auto.betAmount" from file "plugins/CrashGame/players/%player%.yml" to "0" send "&7[&2CRASH&7] &2Auto-bet: &4Wylaczony" to player stop if arg 2 is not set: send "&7[&2CRASH&7] &cNie mozesz postawic zakladu za &6$0" stop if arg 1 is number: set {_gameStatus} to yaml value "system.status" from file "plugins/CrashGame/system.yml" if {_gameStatus} is "waiting": set {_status} to yaml value "status" from file "plugins/CrashGame/players/%player%.yml" if {_status} is "nie gra": if player's balance >= arg 1: if arg 2 isn't set: remove arg 1 from player's balance set {_autoBet} to yaml value "auto.bet" from file "plugins/CrashGame/players/%player%.yml" if {_autoBet} parsed as boolean is false: set action bar of player to "&7[&3Postawiono: &6$%arg 1% &7| &3Zostalo ci: &6%player's balance%&7| &c&lAuto-Bet &7]" send "&7[&2CRASH&7] &2Jezeli chcesz automatycznie dolaczyc do gry wpisz &6/postaw auto" to player if {_autoBet} parsed as boolean is true: set action bar of player to "&7[&3Postawiono: &6$%arg 1% &7| &3Zostalo ci: &6%player's balance% &7| &a&lAuto-Bet &7]" send "&7[&2CRASH&7] &2Zaklad automatycznie postawiony" wait 1 second set yaml value "bet" from file "plugins/CrashGame/players/%player%.yml" to "%arg 1%" set yaml value "status" from file "plugins/CrashGame/players/%player%.yml" to "postawil" set {_licznik} to yaml value "system.licznik" from file "plugins/CrashGame/system.yml" set {_totalBalance} to yaml value "system.totalBalance" from file "plugins/CrashGame/system.yml" set yaml value "system.totalBalance" from file "plugins/CrashGame/system.yml" to "%{_totalBalance} parsed as number + arg 1%" set yaml value "system.licznik" from file "plugins/CrashGame/system.yml" to "%{_licznik} parsed as number + 1%" stop if arg 2 is "auto": set {_autobet} to yaml value "auto.bet" from file "plugins/CrashGame/players/%player%.yml" if {_autobet} parsed as boolean is false: set yaml value "auto.bet" from file "plugins/CrashGame/players/%player%.yml" to "true" set yaml value "auto.betAmount" from file "plugins/CrashGame/players/%player%.yml" to "%arg 1%" send "&7[&2CRASH&7] &2Auto-Bet: &aWlaczony" to player send "&7[&2CRASH&7] &6Wpisz &c/crash &6aby wpelni zautomatyzowac gre" to player stop else: set {_autobet} to yaml value "auto.bet" from file "plugins/CrashGame/players/%player%.yml" if {_autobet} parsed as boolean is false: send "&7[&2CRASH&7] &4Nie posiadasz tyle Pieniedzy! &3Portfel: &6%player's balance%" to player stop if {_autobet} parsed as boolean is true: send "&7[&2CRASH&7] &2Auto-Bet: &4Wylaczony" to player send "&7[&2CRASH&7] &cNiewystarczajaca suma pieniedzy" set yaml value "auto.bet" from file "plugins/CrashGame/players/%player%.yml" to "false" set yaml value "auto.betAmount" from file "plugins/CrashGame/players/%player%.yml" to "0" else: set {_autobet} to yaml value "auto.bet" from file "plugins/CrashGame/players/%player%.yml" if {_autobet} parsed as boolean is false: send "&7[&2CRASH&7] &4Juz postawiles!!" to player stop if {_autobet} parsed as boolean is true: send "&7[&2CRASH&7] &4Nie mozesz postawic poniewaz wlaczony jest Auto-bet" to player else: send "&7[&2CRASH&7] &4Aktualnie trwa runda" to player stop command /crash []: trigger: if arg 1 is not set: set {_gameStatus} to yaml value "system.status" from file "plugins/CrashGame/system.yml" if {_gameStatus} is "game": set {_status} to yaml value "status" from file "plugins/CrashGame/players/%player%.yml" if {_status} is "gra": set {_mnoznik} to yaml value "system.multiplier" from file "plugins/CrashGame/system.yml" set {_bet} to yaml value "bet" from file "plugins/CrashGame/players/%player%.yml" set {_wygrana} to {_bet} parsed as number * {_mnoznik} parsed as number add {_wygrana} to player's balance set {_wygrana} to {_wygrana} - {_bet} parsed as number set {_winMoney} to yaml value "stats.win" from file "plugins/CrashGame/players/%player%.yml" set yaml value "stats.win" from file "plugins/CrashGame/players/%player%.yml" to "%{_winMoney} parsed as number + {_wygrana}%" if {_wygrana} >= 100000: broadcast " " broadcast "&cGracz &6%player% &cwygral: &3%{_wygrana}% &cna mnozniku: &b%{_mnoznik}%" broadcast " " set {_jackpotChance} to {_wygrana} / 100000 set {_licznik} to yaml value "system.licznik" from file "plugins/CrashGame/system.yml" set {_totalBalance} to yaml value "system.totalBalance" from file "plugins/CrashGame/system.yml" set yaml value "system.licznik" from file "plugins/CrashGame/system.yml" to "%{_licznik} parsed as number - 1%" set yaml value "system.totalBalance" from file "plugins/CrashGame/system.yml" to "%{_totalBalance} parsed as number - {_bet} parsed as number%" set yaml value "status" from file "plugins/CrashGame/players/%player%.yml" to "wygral" set yaml value "bet" from file "plugins/CrashGame/players/%player%.yml" to "0" set yaml value "jackpotChance" from file "plugins/CrashGame/players/%player%.yml" to "%{_jackpotChance}%" set action bar of player to "&7[&aWygrales: &b%{_wygrana}% &7| &cSzansa na Jackpot: &b%{_jackpotChance}%%%&7]" stop if {_status} is "wygral": send "&7[&2CRASH&7] &4Juz odebrales wygrana!" to player stop else: send "&7[&2CRASH&7] &4Nie bierzesz udzialu w grze" to player stop else: send "&7[&2CRASH&7] &4Gra jeszcze nie wystartowala!" to player stop else: if arg 1 >= 1: set yaml value "auto.crash" from file "plugins/CrashGame/players/%player%.yml" to "%arg 1%" send "&7[&2CRASH&7] &2Auto-Crash ustawiony na: &c%arg 1%x" to player send "&7[&2CRASH&7] &2aby wylaczyc Auto-Crash ustaw go na &60" to player if arg 1 = 0: set yaml value "auto.crash" from file "plugins/CrashGame/players/%player%.yml" to "-1" send "&7[&2CRASH&7] &cWylaczono Auto-Crash" to player if arg 1 < 0: send "&7[&2CRASH&7] &cNie mozesz ustawic Auto-Crash ponizej &60" to player command /profit: trigger: set {_win} to yaml value "stats.win" from file "plugins/CrashGame/players/%player%.yml" set {_loss} to yaml value "stats.lose" from file "plugins/CrashGame/players/%player%.yml" send "&7[&2CRASH&7] &aOgolna wygrana: &6$%{_win}%" send "&7[&2CRASH&7] &cOgolna przegrana: &6$%{_loss}%" set {_profit} to {_win} parsed as number - {_loss} parsed as number if {_profit} > 0: send "&7[&2CRASH&7] &3Profit: &a$%{_profit}%" if {_profit} = 0: send "&7[&2CRASH&7] &3Profit: &e$0" if {_profit} < 0: send "&7[&2CRASH&7] &3Profit: &4$%{_profit}%" every 1 second: set {_status} to yaml value "system.status" from file "plugins/CrashGame/system.yml" if {_status} is "waiting": set {_liczba} to yaml value "system.cooldown" from file "plugins/CrashGame/system.yml" if {_liczba} parsed as number > 0: set yaml value "system.cooldown" from file "plugins/CrashGame/system.yml" to "%{_liczba} parsed as number - 1%" loop all players: set {_status} to yaml value "status" from file "plugins/CrashGame/players/%loop-player%.yml" if {_status} is "postawil": set action bar of loop-player to "&2Gra rozpocznie sie za: &4%{_liczba}%" if {_liczba} parsed as number = 10: broadcast "&7[&2CRASH&7] &2Gra rozpocznie sie za &c10 sekund" broadcast "&7[&2CRASH&7] &6/bet &2Aby dolaczyc do gry" loop all players: set {_autoBet} to yaml value "auto.bet" from file "plugins/CrashGame/players/%loop-player%.yml" if {_autoBet} parsed as boolean is true: set {_autoBetAmount} to yaml value "auto.betAmount" from file "plugins/CrashGame/players/%loop-player%.yml" execute loop-player command "bet %{_autoBetAmount} parsed as number%" if {_liczba} parsed as number = 0: set yaml value "system.status" from file "plugins/CrashGame/system.yml" to "game" set yaml value "system.cooldown" from file "plugins/CrashGame/system.yml" to "35" broadcast "&7[&2CRASH&7] &2Gra sie rozpoczela!" broadcast "&7[&2CRASH&7] &6/crash &2aby wyplacic pieniadze" loop all players: set {_status} to yaml value "status" from file "plugins/CrashGame/players/%loop-player%.yml" if {_status} is "postawil": set yaml value "status" from file "plugins/CrashGame/players/%loop-player%.yml" to "gra" set {_random} to random number between 1 and 101 if {_random} is between 1 and 35: set yaml value "system.crash" from file "plugins/CrashGame/system.yml" to "%random number between 1.00 and 1.20%" if {_random} is between 36 and 70: set yaml value "system.crash" from file "plugins/CrashGame/system.yml" to "%random number between 1.21 and 3.00%" if {_random} is between 71 and 80: set yaml value "system.crash" from file "plugins/CrashGame/system.yml" to "%random number between 3.01 and 10.00%" if {_random} is between 81 and 90: set yaml value "system.crash" from file "plugins/CrashGame/system.yml" to "%random number between 10.01 and 50.00%" if {_random} is between 91 and 95: set yaml value "system.crash" from file "plugins/CrashGame/system.yml" to "%random number between 50.01 and 250.00%" if {_random} is between 96 and 100: set yaml value "system.crash" from file "plugins/CrashGame/system.yml" to "%random number between 250.01 and 1000.00%" if {_random} is 101: set yaml value "system.crash" from file "plugins/CrashGame/system.yml" to "%random number between 1000.01 and 100000.00%" if {_status} is "game": set {_increase} to yaml value "system.increase" from file "plugins/CrashGame/system.yml" set yaml value "system.increase" from file "plugins/CrashGame/system.yml" to "%{_increase} parsed as number + 0.01%" every 4 tick: set {_status} to yaml value "system.status" from file "plugins/CrashGame/system.yml" if {_status} is "game": set {_mnoznik} to yaml value "system.multiplier" from file "plugins/CrashGame/system.yml" set {_increase} to yaml value "system.increase" from file "plugins/CrashGame/system.yml" set {_mnoznik} to {_mnoznik} parsed as number + {_increase} parsed as number set yaml value "system.multiplier" from file "plugins/CrashGame/system.yml" to "%{_mnoznik}%" set {_crash} to yaml value "system.crash" from file "plugins/CrashGame/system.yml" loop all players: set {_playerStatus} to yaml value "status" from file "plugins/CrashGame/players/%loop-player%.yml" if {_playerStatus} is "gra": set {_bet} to yaml value "bet" from file "plugins/CrashGame/players/%loop-player%.yml" set {_wygrana} to {_bet} parsed as number * {_mnoznik} set {_wygrana} to {_wygrana} - {_bet} parsed as number set action bar of loop-player to "&7[&3Mnoznik: &4%{_mnoznik}%x &7| &aWygrana: &b$%{_wygrana}%&7]" if {_wygrana} > 2000000: execute loop-player command "crash" send "&7[&2CRASH&7] &2Wyplacono automatycznie z powodu przekroczenia limitu" to loop-player set {_autoCrash} to yaml value "auto.crash" from file "plugins/CrashGame/players/%loop-player%.yml" if {_autoCrash} parsed as number > 1: if {_mnoznik} >= {_autoCrash} parsed as number: if {_playerStatus} is "gra": execute loop-player command "crash" send "&7[&2CRASH&7] &2Auto-Crash: &aWyplacono" to loop-player if {_playerStatus} is "wygral": if {_autoCrash} parsed as number > 1: send "&7[&2CRASH&7] &2Auto-Crash: &cWyplacono juz. Anulowanie akcji " to loop-player if {_mnoznik} >= {_crash} parsed as number: set {_licznik} to yaml value "system.licznik" from file "plugins/CrashGame/system.yml" set {_totalBalance} to yaml value "system.totalBalance" from file "plugins/CrashGame/system.yml" set {_jackpot} to yaml value "system.jackpot" from file "plugins/CrashGame/system.yml" set {_jackpot} to {_jackpot} parsed as number + {_totalBalance} parsed as number broadcast " " broadcast "&7[&2CRASH&7] &4CRASH!!!" broadcast "&7[&2CRASH&7] &cZatrzymno na mnozniku: &6%{_mnoznik}%x" broadcast "&7[&2CRASH&7] &cZlapano: &b%{_licznik}% osob" broadcast "&7[&2CRASH&7] &6Jackpot: &b$%{_jackpot}%" broadcast " " set yaml value "system.status" from file "plugins/CrashGame/system.yml" to "waiting" set yaml value "system.multiplier" from file "plugins/CrashGame/system.yml" to "1.00" set yaml value "system.crash" from file "plugins/CrashGame/system.yml" to "0.00" set yaml value "system.increase" from file "plugins/CrashGame/system.yml" to "0" set yaml value "system.licznik" from file "plugins/CrashGame/system.yml" to "0" set yaml value "system.jackpot" from file "plugins/CrashGame/system.yml" to "%{_jackpot}%" loop all players: set {_playerStatus} to yaml value "status" from file "plugins/CrashGame/players/%loop-player%.yml" if {_playerStatus} is "gra": set {_bet} to yaml value "bet" from file "plugins/CrashGame/players/%loop-player%.yml" set action bar of loop-player to "&7[&3Mnoznik: &4CRASH!!! &7| &cPrzegrano: &b$%{_bet}%&7]" set {_lose} to yaml value "stats.lose" from file "plugins/CrashGame/players/%loop-player%.yml" set yaml value "stats.lose" from file "plugins/CrashGame/players/%loop-player%.yml" to "%{_lose} parsed as number + {_bet} parsed as number%" set yaml value "bet" from file "plugins/CrashGame/players/%loop-player%.yml" to "0" set yaml value "status" from file "plugins/CrashGame/players/%loop-player%.yml" to "nie gra" set yaml value "jackpotChance" from file "plugins/CrashGame/players/%loop-player%.yml" to "0" if {_playerStatus} is "wygral": if {_jackpot} > 0: set {_jackpotChance} to yaml value "jackpotChance" from file "plugins/CrashGame/players/%loop-player%.yml" set {_jackpotChance} to {_jackpotChance} parsed as number chance of {_jackpotChance}%: add {_jackpot} to loop-player's balance set {_win} to yaml value "stats.win" from file "plugins/CrashGame/players/%loop-player%.yml" set yaml value "stats.win" from file "plugins/CrashGame/players/%loop-player%.yml" to "%{_win} parsed as number + {_jackpot}%" broadcast " " broadcast "&7[&2CRASH&7] &4Rozbito Jackpot! &cWygrywa &6%loop-player% &cz szansa &b%{_jackpotChance}%%%" broadcast " " set yaml value "system.jackpot" from file "plugins/CrashGame/system.yml" to "0" set yaml value "jackpotChance" from file "plugins/CrashGame/players/%loop-player%.yml" to "0" set yaml value "status" from file "plugins/CrashGame/players/%loop-player%.yml" to "nie gra" set yaml value "system.totalBalance" from file "plugins/CrashGame/system.yml" to "0" on load: if folder "plugins/CrashGame" doesn't exists: create folder "plugins/CrashGame" create file "plugins/CrashGame/system.yml" create folder "plugins/CrashGame/players" wf "system:" to "plugins/CrashGame/system.yml" wf " status: 'waiting'" to "plugins/CrashGame/system.yml" wf " cooldown: '31'" to "plugins/CrashGame/system.yml" wf " multiplier: '1.00'" to "plugins/CrashGame/system.yml" wf " totalBalance: '0'" to "plugins/CrashGame/system.yml" wf " crash: '0'" to "plugins/CrashGame/system.yml" wf " licznik: '0'" to "plugins/CrashGame/system.yml" wf " jackpot: '0'" to "plugins/CrashGame/system.yml" wf " increase: '0'" to "plugins/CrashGame/system.yml" on unload: set yaml value "system.status" from file "plugins/CrashGame/system.yml" to "waiting" set yaml value "system.cooldown" from file "plugins/CrashGame/system.yml" to "31" set yaml value "system.multiplier" from file "plugins/CrashGame/system.yml" to "1.00" set yaml value "system.totalBalance" from file "plugins/CrashGame/system.yml" to "0" set yaml value "system.crash" from file "plugins/CrashGame/system.yml" to "0.00" set yaml value "system.licznik" from file "plugins/CrashGame/system.yml" to "0" set yaml value "system.increase" from file "plugins/CrashGame/system.yml" to "0" loop all players: set yaml value "status" from file "plugins/CrashGame/players/%loop-player%.yml" to "nie gra" set yaml value "bet" from file "plugins/CrashGame/players/%loop-player%.yml" to "0" set yaml value "jackpotChance" from file "plugins/CrashGame/players/%loop-player%.yml" to "0" set yaml value "auto.bet" from file "plugins/CrashGame/players/%loop-player%.yml" to "false" set yaml value "auto.betAmount" from file "plugins/CrashGame/players/%loop-player%.yml" to "0" set yaml value "auto.crash" from file "plugins/CrashGame/players/%loop-player%.yml" to "0" on join: if file "plugins/CrashGame/players/%player%.yml" doesn't exists: create file "plugins/CrashGame/players/%player%.yml" wf "bet: '0'" to "plugins/CrashGame/players/%player%.yml" wf "status: 'nie gra'" to "plugins/CrashGame/players/%player%.yml" wf "jackpotChance: '0'" to "plugins/CrashGame/players/%player%.yml" wf "stats: " to "plugins/CrashGame/players/%player%.yml" wf " win: '0'" to "plugins/CrashGame/players/%player%.yml" wf " lose: '0'" to "plugins/CrashGame/players/%player%.yml" wf "auto:" to "plugins/CrashGame/players/%player%.yml" wf " bet: 'false'" to "plugins/CrashGame/players/%player%.yml" wf " betAmount: '0'" to "plugins/CrashGame/players/%player%.yml" wf " crash: '0'" to "plugins/CrashGame/players/%player%.yml" on quit: set yaml value "status" from file "plugins/CrashGame/players/%player%.yml" to "nie gra" set yaml value "bet" from file "plugins/CrashGame/players/%player%.yml" to "0" set yaml value "jackpotChance" from file "plugins/CrashGame/players/%player%.yml" to "0" set yaml value "auto.bet" from file "plugins/CrashGame/players/%player%.yml" to "false" set yaml value "auto.betAmount" from file "plugins/CrashGame/players/%player%.yml" to "0" set yaml value "auto.crash" from file "plugins/CrashGame/players/%player%.yml" to "0"