#CrashGame by XxMichal10390xX #Wersja: 1.1 command /postaw []: trigger: if arg 1 is not set: send "&c/postaw &7- &2postaw pieniadze na nadchodzaca runde" if arg 1 is set: set {_status} to yaml value "system.status" from file "plugins/CrashGame/gameSystem.yml" if {_status} is "odliczanie": set {_playerStatus} to yaml value "status" from file "plugins/CrashGame/players/%player%.yml" if {_playerStatus} is "nie gra": if player's balance >= arg 1: remove arg 1 from player's balance send "&7[&2CRASH&7] &cPostawiles: &6$%arg 1%" to player send "&7[&2CRASH&7] &cZostalo ci: &6%player's balance%" to player set {_liczba} to yaml value "system.liczba" from file "plugins/CrashGame/gameSystem.yml" set {_stawka} to yaml value "system.totalBalance" from file "plugins/CrashGame/gameSystem.yml" set yaml value "status" from file "plugins/CrashGame/players/%player%.yml" to "postawione" set yaml value "system.liczba" from file "plugins/CrashGame/gameSystem.yml" to "%{_liczba} parsed as number + 1%" set yaml value "system.totalBalance" from file "plugins/CrashGame/gameSystem.yml" to "%{_stawka} parsed as number + arg 1%" set yaml value "bet" from file "plugins/CrashGame/players/%player%.yml" to "%arg 1%" stop else: send "&7[&2CRASH&7] &cNie masz wystarcajaco pieniedzy!" to player stop else: send "&7[&2CRASH&7] &cPostawiles juz w tej rundzie" to player stop else: send "&7[&2CRASH&7] &cNie mozesz postawic poniewaz gra jeszcze trwa" to player stop command /crash: trigger: set {_status} to yaml value "system.status" from file "plugins/CrashGame/gameSystem.yml" set {_playerStatus} to yaml value "status" from file "plugins/CrashGame/players/%player%.yml" set {_postawione} to yaml value "bet" from file "plugins/CrashGame/players/%player%.yml" set {_mnoznik} to yaml value "system.multiplier" from file "plugins/CrashGame/gameSystem.yml" set {_liczba} to yaml value "system.liczba" from file "plugins/CrashGame/gameSystem.yml" if {_status} is "trwa": if {_playerStatus} is "gra": set {_wygrana} to {_postawione} parsed as number * {_mnoznik} parsed as number add {_wygrana} to player's balance 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 {_totalBalance} to yaml value "system.totalBalance" from file "plugins/CrashGame/gameSystem.yml" set yaml value "system.liczba" from file "plugins/CrashGame/gameSystem.yml" to "%{_liczba} parsed as number - 1%" set yaml value "system.totab" from file "plugins/CrashGame/gameSystem.yml" to "%{_liczba} parsed as number - 1%" set {_wygrana} to {_wygrana} - {_postawione} parsed as number set {_szansa} to {_wygrana} / 100000 set yaml value "jackpotChance" from file "plugins/CrashGame/players/%player%.yml" to "%{_szansa}%" set action bar of player to "&8[&aWygrano: &b%{_wygrana}% &8| &6Szansa na Jackpot: &b%{_szansa}%&8]" if {_wygrana} > 100000: broadcast " " broadcast "&7[&2CRASH&7] &cGracz &6%player% &cwygral &3$%{_wygrana}% &cna mnozniku &b%{_mnoznik}%" broadcast " " stop if {_playerStatus} is "wygral": send "&7[&2CRASH&7] &cJuz odebrales wygrana" to players stop if {_playerStatus} is "nie gra": send "&7[&2CRASH&7] &cNie bierzesz udzialu w grze" to player stop else: send "&7[&2CRASH&7] &cGra jeszcze nie wystartowala" to player stop every 4 tick: set {_status} to yaml value "system.status" from file "plugins/CrashGame/gameSystem.yml" if {_status} is "trwa": set {_mnoznik} to yaml value "system.multiplier" from file "plugins/CrashGame/gameSystem.yml" set {_crash} to yaml value "system.crash" from file "plugins/CrashGame/gameSystem.yml" if {_mnoznik} parsed as number is between 1.00 and 2.00: set yaml value "system.multiplier" from file "plugins/CrashGame/gameSystem.yml" to "%{_mnoznik} parsed as number + 0.02%" if {_mnoznik} parsed as number is between 2.01 and 5.00: set yaml value "system.multiplier" from file "plugins/CrashGame/gameSystem.yml" to "%{_mnoznik} parsed as number + 0.05%" if {_mnoznik} parsed as number is between 5.01 and 20.00: set yaml value "system.multiplier" from file "plugins/CrashGame/gameSystem.yml" to "%{_mnoznik} parsed as number + 0.1%" if {_mnoznik} parsed as number is between 20.01 and 100.00: set yaml value "system.multiplier" from file "plugins/CrashGame/gameSystem.yml" to "%{_mnoznik} parsed as number + 0.5%" if {_mnoznik} parsed as number is between 100.01 and 500.00: set yaml value "system.multiplier" from file "plugins/CrashGame/gameSystem.yml" to "%{_mnoznik} parsed as number + 1%" if {_mnoznik} parsed as number > 500.01: set yaml value "system.multiplier" from file "plugins/CrashGame/gameSystem.yml" to "%{_mnoznik} parsed as number + 5%" loop all players: set {_playerStatus} to yaml value "status" from file "plugins/CrashGame/players/%loop-player%.yml" if {_playerStatus} is "gra": set {_mnoznik} to yaml value "system.multiplier" from file "plugins/CrashGame/gameSystem.yml" set action bar of loop-player to "&8[ &4%{_mnoznik}% &8| &6/crash &2aby wyplacic! &8]" if {_mnoznik} parsed as number >= {_crash} parsed as number: set {_liczba} to yaml value "system.liczba" from file "plugins/CrashGame/gameSystem.yml" set {_totalBalance} to yaml value "system.totalBalance" from file "plugins/CrashGame/gameSystem.yml" set {_jackpot} to yaml value "system.jackpot" from file "plugins/CrashGame/gameSystem.yml" set {_jackpot} to {_jackpot} parsed as number + {_totalBalance} parsed as number broadcast " " broadcast "&7[&2CRASH&7] &cMnoznik: &b%{_mnoznik}%" broadcast "&7[&2CRASH&7] &cIlosc graczy w czasie crash'a: &6%{_liczba}%" broadcast "&7[&2CRASH&7] &cSuma w puli: &6$%{_totalBalance}%" broadcast "&7[&2CRASH&7] &cJackpot: &6$%{_jackpot} parsed as number + {_totalBalance} parsed as number%" broadcast " " set yaml value "system.status" from file "plugins/CrashGame/gameSystem.yml" to "odliczanie" set yaml value "system.multiplier" from file "plugins/CrashGame/gameSystem.yml" to "1.00" set yaml value "system.crash" from file "plugins/CrashGame/gameSystem.yml" to "0.00" 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 "&8[&4&lCRASH!!! &8| &cPrzegrano: %{_bet}%&8]" 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 broadcast " " broadcast "&7[&2CRASH&7] &4Rozbito Jackpot! &cWygrywa &6%loop-player% &cz szansa &b%{_jackpotChance}%%%" broadcast " " set action bar of loop-player to "&8[&6Jackpot: &b%{_jackpot}%&8]" set yaml value "system.jackpot" 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 "status" from file "plugins/CrashGame/players/%loop-player%.yml" to "nie gra" set yaml value "system.totalBalance" from file "plugins/CrashGame/gameSystem.yml" to "0" stop every 1 second: set {_status} to yaml value "system.status" from file "plugins/CrashGame/gameSystem.yml" if {_status} is "odliczanie": set {_liczba} to yaml value "system.cooldown" from file "plugins/CrashGame/gameSystem.yml" if {_liczba} parsed as number > 0: set yaml value "system.cooldown" from file "plugins/CrashGame/gameSystem.yml" to "%{_liczba} parsed as number - 1%" if {_liczba} parsed as number = 30: broadcast "&7[&2CRASH&7] &2Gra rozpocznie sie za &c30 sekund" broadcast "&7[&2CRASH&7] &2Aby dolaczyc wpisz &6/postaw " if {_liczba} parsed as number = 15: broadcast "&7[&2CRASH&7] &2Gra rozpocznie sie za &c15 sekund" broadcast "&7[&2CRASH&7] &2Aby dolaczyc wpisz &6/postaw " if {_liczba} parsed as number = 10: broadcast "&7[&2CRASH&7] &2Gra rozpocznie sie za &c10 sekund" broadcast "&7[&2CRASH&7] &2Aby dolaczyc wpisz &6/postaw " if {_liczba} parsed as number <= 5: broadcast "&7[&2CRASH&7] &2Gra rozpocznie sie za &c%{_liczba}%" if {_liczba} parsed as number = 0: set yaml value "system.status" from file "plugins/CrashGame/gameSystem.yml" to "gra" set yaml value "system.cooldown" from file "plugins/CrashGame/gameSystem.yml" to "34" broadcast "&7[&2CRASH&7] &2Gra sie rozpoczela!" loop all players: set {_status} to yaml value "status" from file "plugins/CrashGame/players/%loop-player%.yml" if {_status} is "postawione": set yaml value "status" from file "plugins/CrashGame/players/%loop-player%.yml" to "gra" set yaml value "system.status" from file "plugins/CrashGame/gameSystem.yml" to "trwa" set {_random} to random number between 1 and 101 if {_random} is between 1 and 70: set yaml value "system.crash" from file "plugins/CrashGame/gameSystem.yml" to "%random number between 1.00 and 3.00%" if {_random} is between 71 and 80: set yaml value "system.crash" from file "plugins/CrashGame/gameSystem.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/gameSystem.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/gameSystem.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/gameSystem.yml" to "%random number between 250.01 and 1000.00%" if {_random} is 101: set yaml value "system.crash" from file "plugins/CrashGame/gameSystem.yml" to "%random number between 1000.01 and 100000.00%" on load: if folder "plugins/CrashGame" doesn't exists: create folder "plugins/CrashGame" create file "plugins/CrashGame/gameSystem.yml" create folder "plugins/CrashGame/players" wf "system:" to "plugins/CrashGame/gameSystem.yml" wf " status: 'odliczanie'" to "plugins/CrashGame/gameSystem.yml" wf " cooldown: '31'" to "plugins/CrashGame/gameSystem.yml" wf " multiplier: '1.00'" to "plugins/CrashGame/gameSystem.yml" wf " totalBalance: '0'" to "plugins/CrashGame/gameSystem.yml" wf " crash: '0'" to "plugins/CrashGame/gameSystem.yml" wf " liczba: '0'" to "plugins/CrashGame/gameSystem.yml" wf " jackpot: '0'" to "plugins/CrashGame/gameSystem.yml" on unload: set yaml value "system.status" from file "plugins/CrashGame/gameSystem.yml" to "odliczanie" set yaml value "system.cooldown" from file "plugins/CrashGame/gameSystem.yml" to "31" set yaml value "system.multiplier" from file "plugins/CrashGame/gameSystem.yml" to "1.00" set yaml value "system.totalBalance" from file "plugins/CrashGame/gameSystem.yml" to "0" set yaml value "system.crash" from file "plugins/CrashGame/gameSystem.yml" to "0.00" set yaml value "system.liczba" from file "plugins/CrashGame/gameSystem.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" 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"