Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ==========================================
- # GŁÓWNA KOMENDA
- # ==========================================
- command /cs-case [<text>] [<text>] [<text>] [<number>]:
- trigger:
- if arg-1 is not set:
- set {_first-menu} to chest inventory with 4 rows named "&0CS-Case"
- set slot 11 of {_first-menu} to ender pearl named "&aInformacje o skrypcie"
- set slot 13 of {_first-menu} to yellow wool named "&eMenu główne"
- set slot 15 of {_first-menu} to emerald named "&aStan konta"
- set slot 31 of {_first-menu} to barrier named "&cZamknij"
- open {_first-menu} to player
- if arg-1 is "version" or "ver" or "v":
- send "&fAktualna wersja &aCS-Case &fto &a1.0" to player
- send "&fOpis skryptu: &aProsty skrypt na lsowanie broni z CS:GO!" to player
- send "&fAutor: &aKokos747"
- else if arg-1 is "menu" or "m":
- set {_main-menu} to chest inventory with 4 rows named "&0Menu główne"
- set slot 11 of {_main-menu} to netherite sword named "&cWalka o skiny &7(WKRÓTCE)"
- set slot 13 of {_main-menu} to golden pickaxe named "&eLosowanie skinów"
- set slot 15 of {_main-menu} to emerald named "&aSprzedaż skinów"
- set slot 31 of {_main-menu} to barrier named "&cPowrót"
- open {_main-menu} to player
- else if arg-1 is "kasa" or "k" or "balance" or "bal":
- send "&aStan konta: &2%balance of player%" to player
- send "&aMiejsce w topce kasy: &2#%{miejsce::%player%}%" to player
- else if arg-1 is "admin":
- if player has permission "case.admin":
- # --- SEKCJA PIENIĘDZY ---
- if arg-2 is "ustawkase":
- if arg-3 is set:
- if arg-4 is set:
- set {_p} to arg-3 parsed as offline player
- set {_n} to arg-4
- if {_p} is set:
- set balance of {_p} to {_n}
- set {kasa::%{_p}%} to {_n}
- send "&aPomyślnie ustawiłeś stan konta gracza &2%arg-3% &ana &2$%arg-4%!" to player
- if {_p} is online:
- send "&aGracz &2%player% &austawił twój stan konta na &2$%arg-4%!" to {_p}
- else:
- send "&cNie znaleziono takiego gracza!"
- else:
- send "&cMusisz podać ilość!"
- else:
- send "&cMusisz nick gracza!"
- else if arg-2 is "dodajkase":
- if arg-3 is set:
- if arg-4 is set:
- set {_p} to arg-3 parsed as offline player
- set {_n} to arg-4
- if {_p} is set:
- add {_n} to balance of {_p}
- add {_n} to {kasa::%{_p}%}
- send "&aPomyślnie dodałeś &2$%arg-4% &ado stanu konta gracza &2%arg-3%!" to player
- if {_p} is online:
- send "&aGracz &2%player% &adodał &2$%arg-4% &ado twojego stanu konta!" to {_p}
- else:
- send "&cNie znaleziono takiego gracza!"
- else:
- send "&cMusisz podać ilość!"
- else:
- send "&cMusisz nick gracza!"
- else if arg-2 is "reload":
- execute console command "sk reload CS-Case.sk"
- send "&aPomyślnie przeładowano skrypt!"
- else:
- send "<##C9401A>#== <##C9401A>&lCENTRUM KOMEND ADMINA <##C9401A>==#" to player
- send "<##C9401A>&l1. <##D99280>/cs-case admin ustawkase <nick> <ilość>" to player
- send "<##C9401A>&l2. <##D99280>/cs-case admin dodajkase <nick> <ilość>" to player
- send "<##C9401A>&l3. <##D99280>/dodajgold <slot> &7- Dodaje item do puli gold!" to player
- send "<##C9401A>&l4. <##D99280>/usungold <slot> &7- Czyści pulę gold!" to player
- send "<##C9401A>&l5. <##D99280>/cs-case admin reload" to player
- else:
- send "&cNie posiadasz permisji!" to player
- send "&cGracz &4%player% &cpróbował użyć komendy &4/cs-case admin!" to all ops
- # ==========================================
- # OSOBNE KOMENDY GOLD
- # ==========================================
- command /dodajgold [<integer>]:
- permission: case.admin
- permission message: &cNie posiadasz permisji!
- trigger:
- if arg-1 is set:
- if player's tool is not air:
- add player's tool to {gold::pool::%arg-1%::*}
- send "&6&lZŁOTA PULA &aDodano przedmiot do ZŁOTEJ puli dla skrzynki w slocie &2%arg-1%!" to player
- else:
- send "&cMusisz trzymać przedmiot w ręce!"
- else:
- send "&cPodaj numer slotu skrzynki! Użycie: /dodajgold <slot>"
- command /usungold [<integer>]:
- permission: case.admin
- permission message: &cNie posiadasz permisji!
- trigger:
- if arg-1 is set:
- delete {gold::pool::%arg-1%::*}
- send "&6&lZŁOTA PULA &cWyczyszczono pulę ZŁOTYCH przedmiotów dla skrzynki w slocie &4%arg-1%!" to player
- else:
- send "&cPodaj numer slotu! Użycie: /usungold <slot>"
- # ==========================================
- # GUI GŁÓWNE
- # ==========================================
- on inventory click:
- event-inventory is not player's inventory
- if name of event-inventory is "&0Menu główne":
- cancel event
- if clicked slot is 31:
- execute player command "cs-case"
- else if clicked slot is 13:
- execute player command "skrzynki"
- else if clicked slot is 15:
- execute player command "cs-case kasa"
- close player's inventory
- on inventory click:
- event-inventory is not player's inventory
- if name of event-inventory is "&0CS-Case":
- cancel event
- if clicked slot is 31:
- close player's inventory
- else if clicked slot is 11:
- execute player command "cs-case version"
- close player's inventory
- else if clicked slot is 13:
- execute player command "cs-case menu"
- else if clicked slot is 15:
- execute player command "cs-case kasa"
- close player's inventory
- # ==========================================
- # STATYSTYKI I ACTIONBAR
- # ==========================================
- every 1 minute:
- set {_topka::*} to sorted indices of {kasa::*} in descending order
- delete {miejsce::*}
- loop {_topka::*}:
- set {_u} to loop-value
- set {miejsce::%{_u}%} to loop-index
- every 1 second:
- loop all players:
- send action bar "&aStan konta: &2%balance of loop-player% &8| &eMiejsce w topce kasy: &6#%{miejsce::%loop-player%}% &8| <##80C0D9>Gracze online: <##C1DEE8>%amount of all players%" to loop-player
- # ==========================================
- # KOMENDA /SKRZYNKI
- # ==========================================
- command /skrzynki:
- trigger:
- set {_gui} to chest inventory with 4 rows named "&0Losowanie skinów"
- loop integers from 0 to 35:
- set {_slot} to loop-value
- if {skrzynki::przedmioty::%{_slot}%} is set:
- set {_nazwa} to colored {skrzynki::nazwy::%{_slot}%}
- set {_item} to {skrzynki::przedmioty::%{_slot}%}
- set {_cena_wyswietlana} to {skrzynki::cena::%{_slot}%}
- if {_cena_wyswietlana} is not set:
- set {_cena_wyswietlana} to "&cBłąd ceny"
- set {_lore::0} to ""
- set {_lore::1} to "&eKliknij &6LPM&e, aby zobaczyć drop!"
- set {_lore::2} to "&eKliknij &6PPM&e, aby otworzyć!"
- set {_lore::3} to ""
- set {_lore::4} to "&aCena otwarcia: &2$%{_cena_wyswietlana}%"
- set {_lore::5} to ""
- set slot {_slot} of {_gui} to {_item} named {_nazwa} with lore {_lore::*}
- set slot 31 of {_gui} to barrier named "&cPowrót"
- open {_gui} to player
- # ==========================================
- # KLIKNIĘCIA W SKRZYNKI
- # ==========================================
- on inventory click:
- if name of event-inventory is "&0Losowanie skinów":
- cancel event
- if clicked slot is 31:
- execute player command "cs-case menu"
- stop
- if event-slot is not air:
- set {_slot} to index of event-slot
- if {skrzynki::przedmioty::%{_slot}%} is set:
- # LPM - Podgląd
- if click type is left mouse button:
- open_drop_preview(player, {_slot})
- # PPM - Otwieranie
- else if click type is right mouse button:
- set {_cena} to {skrzynki::cena::%{_slot}%}
- if size of {skrzynki::drop::%{_slot}%::itemy::*} is 0:
- send "&cTa skrzynka jest pusta!" to player
- stop
- if {_cena} is not set:
- close player's inventory
- send "&4&lBŁĄD KONFIGURACJI CENY!" to player
- stop
- set {_balans} to player's balance
- if {_balans} is not set:
- set {_balans} to 0
- if {_balans} >= {_cena}:
- remove {_cena} from player's balance
- close player's inventory
- start_csgo_animation(player, {_slot})
- else:
- close player's inventory
- send "&cNie posiadasz wystarczającej ilości pieniędzy!" to player
- if name of event-inventory contains "&0Otwieranie:":
- cancel event
- # ==========================================
- # ANIMACJA I PODMIANA NAGRÓD (Z NOWYM SYSTEMEM FLOAT - LORE ONLY)
- # ==========================================
- function start_csgo_animation(p: player, slot: integer):
- set {_p} to {_p}
- # 1. Losowanie (Standardowe)
- set {_total_chance} to 0
- loop {skrzynki::drop::%{_slot}%::szanse::*}:
- add loop-value to {_total_chance}
- set {_random} to random number between 0 and {_total_chance}
- set {_current_check} to 0
- set {_winner} to air
- loop {skrzynki::drop::%{_slot}%::szanse::*}:
- add loop-value to {_current_check}
- if {_current_check} >= {_random}:
- set {_winner} to {skrzynki::drop::%{_slot}%::itemy::%loop-index%}
- stop loop
- if {_winner} is air:
- set {_list::*} to {skrzynki::drop::%{_slot}%::itemy::*}
- set {_winner} to random element out of {_list::*}
- # 2. GUI Animacji
- set {_gui_name} to colored {skrzynki::nazwy::%{_slot}%}
- set {_anim_gui} to chest inventory with 3 rows named "&0Otwieranie: %{_gui_name}%"
- set {_glass} to black stained glass pane named "&8..."
- set slot 0 and 1 and 2 and 3 and 5 and 6 and 7 and 8 of {_anim_gui} to {_glass}
- set slot 18 and 19 and 20 and 21 and 23 and 24 and 25 and 26 of {_anim_gui} to {_glass}
- set slot 4 of {_anim_gui} to hopper named "&6&l⬇ TWOJA NAGRODA ⬇"
- set slot 22 of {_anim_gui} to bedrock named "&6&l⬆ TWOJA NAGRODA ⬆"
- set {_drops::*} to {skrzynki::drop::%{_slot}%::itemy::*}
- loop integers from 9 to 17:
- set slot loop-value of {_anim_gui} to random element out of {_drops::*}
- open {_anim_gui} to {_p}
- # 3. Pętla (Rolling)
- set {_speed} to 2
- set {_steps} to 0
- set {_total_steps} to 40
- play sound "block.chest.open" with volume 1 and pitch 1 to {_p}
- while {_steps} < {_total_steps}:
- add 1 to {_steps}
- loop integers from 9 to 16:
- set {_next_item} to slot (loop-value + 1) of {_anim_gui}
- set slot loop-value of {_anim_gui} to {_next_item}
- if {_steps} is ({_total_steps} - 4):
- set slot 17 of {_anim_gui} to {_winner}
- else:
- set slot 17 of {_anim_gui} to random element out of {_drops::*}
- play sound "ui.button.click" with volume 0.5 and pitch 2 to {_p}
- if {_steps} > 30:
- add 1 to {_speed}
- if {_steps} > 35:
- add 2 to {_speed}
- wait "%{_speed}% ticks" parsed as timespan
- if name of top inventory of {_p} is not "&0Otwieranie: %{_gui_name}%":
- stop loop
- # 4. Sprawdzenie Złotej / Czerwonej nagrody
- set {_final_reward} to {_winner}
- set {_is_special} to false
- # --- LOGIKA ZŁOTEGO DROPU ---
- if type of {_final_reward} is yellow candle:
- if size of {gold::pool::%{_slot}%::*} > 0:
- set {_final_reward} to random element out of {gold::pool::%{_slot}%::*}
- set {_is_special} to true
- set {_display_name} to name of {_final_reward}
- if {_display_name} is not set:
- set {_display_name} to "%type of {_final_reward}%"
- set {_display_name} to "%{_display_name}%" in upper case
- broadcast ""
- broadcast "&e&k| &6&lLEGENDARNY ZŁOTY DROP! &e&k|"
- broadcast "&eGracz &6%{_p}% &ewydropił &6%{_display_name}%&e!"
- broadcast "&eZe skrzynki: &f%{_gui_name}%"
- broadcast ""
- else:
- send "&c[Błąd] Wylosowałeś złoty item, ale pula nagród dla TEJ skrzynki (slot %{_slot}%) jest pusta! Zgłoś to adminowi." to {_p}
- # --- LOGIKA CZERWONEGO DROPU ---
- else if type of {_final_reward} is red candle:
- set {_is_special} to true
- set {_display_name} to name of {_final_reward}
- if {_display_name} is not set:
- set {_display_name} to "%type of {_final_reward}%"
- set {_display_name} to "%{_display_name}%" in upper case
- broadcast ""
- broadcast "&c&k| &4&lMITYCZNY CZERWONY DROP! &c&k|"
- broadcast "&cGracz &4%{_p}% &cwydropił &4%{_display_name}%&c!"
- broadcast "&cZe skrzynki: &f%{_gui_name}%"
- broadcast ""
- # 5. --- SYSTEM FLOAT (Lore + Nazwa) ---
- # Generujemy float od 0.0000 do 1.0000
- set {_float} to random number between 0.000000 and 1.000000
- set {_wear_status} to "&7Unknown"
- # Określanie nazwy zużycia (standard CS:GO)
- if {_float} < 0.07:
- set {_wear_status} to "&bFactory New (FN)"
- else if {_float} < 0.15:
- set {_wear_status} to "&aMinimal Wear (MW)"
- else if {_float} < 0.38:
- set {_wear_status} to "&eField-Tested (FT)"
- else if {_float} < 0.45:
- set {_wear_status} to "&6Well-Worn (WW)"
- else:
- set {_wear_status} to "&cBattle-Scarred (BS)"
- # Dodawanie Lore do przedmiotu (Tylko opis, bez niszczenia durability)
- add "" to lore of {_final_reward}
- add "&8&m------------------" to lore of {_final_reward}
- add "&7Stan: %{_wear_status}%" to lore of {_final_reward}
- add "&7Float: &8%{_float}%" to lore of {_final_reward}
- add "&8&m------------------" to lore of {_final_reward}
- # 6. Finał i Tytuł
- set slot 13 of {_anim_gui} to {_final_reward}
- if {_is_special} is true:
- play sound "ui.toast.challenge_complete" with volume 1 and pitch 1 to {_p}
- play sound "entity.wither.spawn" with volume 0.5 and pitch 1 to {_p}
- else:
- play sound "entity.player.levelup" with volume 1 and pitch 1 to {_p}
- play sound "entity.firework_rocket.large_blast" with volume 1 and pitch 1 to {_p}
- set {_title_name} to name of {_final_reward}
- if {_title_name} is not set:
- set {_title_name} to "%type of {_final_reward}%"
- set {_title_name} to "%{_title_name}%" in upper case
- send title "&6&lWYLOSOWANO!" with subtitle "&fOtrzymujesz: &e%{_title_name}%" to {_p} for 4 seconds
- if {_is_special} is true:
- set {_win_glass} to yellow stained glass pane named "&6&lLEGENDARNA WYGRANA!"
- else:
- set {_win_glass} to lime stained glass pane named "&a&lWYGRANA!"
- set slot 0 and 1 and 2 and 3 and 5 and 6 and 7 and 8 of {_anim_gui} to {_win_glass}
- set slot 18 and 19 and 20 and 21 and 23 and 24 and 25 and 26 of {_anim_gui} to {_win_glass}
- wait 1.3 seconds
- give {_final_reward} to {_p}
- close {_p}'s inventory
- # ==========================================
- # FUNKCJE POMOCNICZE
- # ==========================================
- function open_drop_preview(p: player, slot: integer):
- set {_nazwa} to colored {skrzynki::nazwy::%{_slot}%}
- set {_gui} to chest inventory with 4 rows named "&0Drop: %{_nazwa}%"
- if size of {skrzynki::drop::%{_slot}%::itemy::*} is 0:
- set slot 13 of {_gui} to barrier named "&4&lBŁĄD!" with lore "&cTa skrzynka nie ma jeszcze" and "&cskonfigurowanego żadnego dropu!"
- else:
- set {_i} to 0
- loop {skrzynki::drop::%{_slot}%::itemy::*}:
- if {_i} < 36:
- set {_item} to loop-value
- set {_chance} to {skrzynki::drop::%{_slot}%::szanse::%loop-index%}
- set slot {_i} of {_gui} to {_item} with lore "" and "&7Szansa: &a%{_chance}%%%" and ""
- add 1 to {_i}
- set slot 31 of {_gui} to barrier named "&cPowrót"
- open {_gui} to {_p}
- on inventory click:
- if name of event-inventory contains "&0Drop: ":
- cancel event
- if name of event-slot is "&cPowrót":
- execute player command "skrzynki"
- # ==========================================
- # ADMIN: ZARZĄDZANIE SKRZYNKAMI I DROPEM
- # ==========================================
- command /dodajskrzynke [<item>] [<text>] [<number>] [<integer>]:
- trigger:
- if player has permission "case.admin":
- if arg-1 or arg-2 or arg-3 or arg-4 is not set:
- send "&8&m──────&r &2&lSKRZYNKI &8&m──────" to player
- send "&2Użycie: &a/dodajskrzynke <przedmiot> <nazwa> <cena> <slot>" to player
- stop
- set {_slot} to arg-4
- set {_cena} to arg-3
- set {_nazwa} to arg-2
- replace every "-" in {_nazwa} with " "
- set {skrzynki::przedmioty::%{_slot}%} to arg-1
- set {skrzynki::nazwy::%{_slot}%} to {_nazwa}
- set {skrzynki::cena::%{_slot}%} to {_cena}
- send "&aDodano skrzynkę na slot %{_slot}%." to player
- else:
- send "&cNie posiadasz permisji!" to player
- command /usunskrzynke [<integer>]:
- trigger:
- if player has permission "case.admin":
- if arg-1 is set:
- delete {skrzynki::przedmioty::%arg-1%}
- delete {skrzynki::nazwy::%arg-1%}
- delete {skrzynki::cena::%arg-1%}
- delete {skrzynki::drop::%arg-1%::itemy::*}
- delete {skrzynki::drop::%arg-1%::szanse::*}
- send "&cUsunięto skrzynkę ze slotu %arg-1%." to player
- else:
- send "&cPodaj slot."
- else:
- send "&cNie posiadasz permisji!"
- command /dodajdrop [<text>] [<integer>]:
- trigger:
- if player has permission "case.admin":
- if arg-1 or arg-2 is not set:
- send "&6Użycie: &e/dodajdrop <szansa%%> <slot skrzynki>" to player
- send "&7Trzymaj w ręce przedmiot! Użyj &eYellow Candle &7dla Złotego, &cRed Candle &7dla Czerwonego." to player
- stop
- if player's tool is air:
- send "&cMusisz trzymać przedmiot w ręce!" to player
- stop
- set {_s} to arg-1
- replace all "," with "." in {_s}
- set {_szansa} to {_s} parsed as number
- add player's tool to {skrzynki::drop::%arg-2%::itemy::*}
- add {_szansa} to {skrzynki::drop::%arg-2%::szanse::*}
- send "&aDodano drop do skrzynki (slot %arg-2%) z szansą %{_szansa}%%%." to player
- else:
- send "&cNie posiadasz permisji!" to player
- command /usundrop [<integer>]:
- permission: case.admin
- trigger:
- if arg-1 is set:
- delete {skrzynki::drop::%arg-1%::itemy::*}
- delete {skrzynki::drop::%arg-1%::szanse::*}
- send "&cWyczyszczono drop ze skrzynki %arg-1%." to player
- else:
- send "&cUżycie: &4/usundrop <slot>" to player
- on first join:
- set {kasa::%player%} to 0
Advertisement
Add Comment
Please, Sign In to add comment