Guest User

Untitled

a guest
Dec 19th, 2025
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.04 KB | None | 0 0
  1. # ==========================================
  2. # GŁÓWNA KOMENDA
  3. # ==========================================
  4. command /cs-case [<text>] [<text>] [<text>] [<number>]:
  5. trigger:
  6. if arg-1 is not set:
  7. set {_first-menu} to chest inventory with 4 rows named "&0CS-Case"
  8. set slot 11 of {_first-menu} to ender pearl named "&aInformacje o skrypcie"
  9. set slot 13 of {_first-menu} to yellow wool named "&eMenu główne"
  10. set slot 15 of {_first-menu} to emerald named "&aStan konta"
  11. set slot 31 of {_first-menu} to barrier named "&cZamknij"
  12. open {_first-menu} to player
  13.  
  14. if arg-1 is "version" or "ver" or "v":
  15. send "&fAktualna wersja &aCS-Case &fto &a1.0" to player
  16. send "&fOpis skryptu: &aProsty skrypt na lsowanie broni z CS:GO!" to player
  17. send "&fAutor: &aKokos747"
  18.  
  19. else if arg-1 is "menu" or "m":
  20. set {_main-menu} to chest inventory with 4 rows named "&0Menu główne"
  21. set slot 11 of {_main-menu} to netherite sword named "&cWalka o skiny &7(WKRÓTCE)"
  22. set slot 13 of {_main-menu} to golden pickaxe named "&eLosowanie skinów"
  23. set slot 15 of {_main-menu} to emerald named "&aSprzedaż skinów"
  24. set slot 31 of {_main-menu} to barrier named "&cPowrót"
  25. open {_main-menu} to player
  26.  
  27. else if arg-1 is "kasa" or "k" or "balance" or "bal":
  28. send "&aStan konta: &2%balance of player%" to player
  29. send "&aMiejsce w topce kasy: &2#%{miejsce::%player%}%" to player
  30.  
  31. else if arg-1 is "admin":
  32. if player has permission "case.admin":
  33.  
  34. # --- SEKCJA PIENIĘDZY ---
  35. if arg-2 is "ustawkase":
  36. if arg-3 is set:
  37. if arg-4 is set:
  38. set {_p} to arg-3 parsed as offline player
  39. set {_n} to arg-4
  40.  
  41. if {_p} is set:
  42. set balance of {_p} to {_n}
  43. set {kasa::%{_p}%} to {_n}
  44. send "&aPomyślnie ustawiłeś stan konta gracza &2%arg-3% &ana &2$%arg-4%!" to player
  45. if {_p} is online:
  46. send "&aGracz &2%player% &austawił twój stan konta na &2$%arg-4%!" to {_p}
  47. else:
  48. send "&cNie znaleziono takiego gracza!"
  49. else:
  50. send "&cMusisz podać ilość!"
  51. else:
  52. send "&cMusisz nick gracza!"
  53.  
  54. else if arg-2 is "dodajkase":
  55. if arg-3 is set:
  56. if arg-4 is set:
  57. set {_p} to arg-3 parsed as offline player
  58. set {_n} to arg-4
  59.  
  60. if {_p} is set:
  61. add {_n} to balance of {_p}
  62. add {_n} to {kasa::%{_p}%}
  63. send "&aPomyślnie dodałeś &2$%arg-4% &ado stanu konta gracza &2%arg-3%!" to player
  64. if {_p} is online:
  65. send "&aGracz &2%player% &adodał &2$%arg-4% &ado twojego stanu konta!" to {_p}
  66. else:
  67. send "&cNie znaleziono takiego gracza!"
  68. else:
  69. send "&cMusisz podać ilość!"
  70. else:
  71. send "&cMusisz nick gracza!"
  72.  
  73. else if arg-2 is "reload":
  74. execute console command "sk reload CS-Case.sk"
  75. send "&aPomyślnie przeładowano skrypt!"
  76. else:
  77. send "<##C9401A>#== <##C9401A>&lCENTRUM KOMEND ADMINA <##C9401A>==#" to player
  78. send "<##C9401A>&l1. <##D99280>/cs-case admin ustawkase <nick> <ilość>" to player
  79. send "<##C9401A>&l2. <##D99280>/cs-case admin dodajkase <nick> <ilość>" to player
  80. send "<##C9401A>&l3. <##D99280>/dodajgold <slot> &7- Dodaje item do puli gold!" to player
  81. send "<##C9401A>&l4. <##D99280>/usungold <slot> &7- Czyści pulę gold!" to player
  82. send "<##C9401A>&l5. <##D99280>/cs-case admin reload" to player
  83. else:
  84. send "&cNie posiadasz permisji!" to player
  85. send "&cGracz &4%player% &cpróbował użyć komendy &4/cs-case admin!" to all ops
  86.  
  87. # ==========================================
  88. # OSOBNE KOMENDY GOLD
  89. # ==========================================
  90.  
  91. command /dodajgold [<integer>]:
  92. permission: case.admin
  93. permission message: &cNie posiadasz permisji!
  94. trigger:
  95. if arg-1 is set:
  96. if player's tool is not air:
  97. add player's tool to {gold::pool::%arg-1%::*}
  98. send "&6&lZŁOTA PULA &aDodano przedmiot do ZŁOTEJ puli dla skrzynki w slocie &2%arg-1%!" to player
  99. else:
  100. send "&cMusisz trzymać przedmiot w ręce!"
  101. else:
  102. send "&cPodaj numer slotu skrzynki! Użycie: /dodajgold <slot>"
  103.  
  104. command /usungold [<integer>]:
  105. permission: case.admin
  106. permission message: &cNie posiadasz permisji!
  107. trigger:
  108. if arg-1 is set:
  109. delete {gold::pool::%arg-1%::*}
  110. send "&6&lZŁOTA PULA &cWyczyszczono pulę ZŁOTYCH przedmiotów dla skrzynki w slocie &4%arg-1%!" to player
  111. else:
  112. send "&cPodaj numer slotu! Użycie: /usungold <slot>"
  113.  
  114. # ==========================================
  115. # GUI GŁÓWNE
  116. # ==========================================
  117.  
  118. on inventory click:
  119. event-inventory is not player's inventory
  120. if name of event-inventory is "&0Menu główne":
  121. cancel event
  122. if clicked slot is 31:
  123. execute player command "cs-case"
  124. else if clicked slot is 13:
  125. execute player command "skrzynki"
  126. else if clicked slot is 15:
  127. execute player command "cs-case kasa"
  128. close player's inventory
  129.  
  130. on inventory click:
  131. event-inventory is not player's inventory
  132. if name of event-inventory is "&0CS-Case":
  133. cancel event
  134. if clicked slot is 31:
  135. close player's inventory
  136. else if clicked slot is 11:
  137. execute player command "cs-case version"
  138. close player's inventory
  139. else if clicked slot is 13:
  140. execute player command "cs-case menu"
  141. else if clicked slot is 15:
  142. execute player command "cs-case kasa"
  143. close player's inventory
  144.  
  145. # ==========================================
  146. # STATYSTYKI I ACTIONBAR
  147. # ==========================================
  148.  
  149. every 1 minute:
  150. set {_topka::*} to sorted indices of {kasa::*} in descending order
  151. delete {miejsce::*}
  152. loop {_topka::*}:
  153. set {_u} to loop-value
  154. set {miejsce::%{_u}%} to loop-index
  155.  
  156. every 1 second:
  157. loop all players:
  158. 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
  159.  
  160.  
  161. # ==========================================
  162. # KOMENDA /SKRZYNKI
  163. # ==========================================
  164.  
  165. command /skrzynki:
  166. trigger:
  167. set {_gui} to chest inventory with 4 rows named "&0Losowanie skinów"
  168.  
  169. loop integers from 0 to 35:
  170. set {_slot} to loop-value
  171. if {skrzynki::przedmioty::%{_slot}%} is set:
  172. set {_nazwa} to colored {skrzynki::nazwy::%{_slot}%}
  173. set {_item} to {skrzynki::przedmioty::%{_slot}%}
  174. set {_cena_wyswietlana} to {skrzynki::cena::%{_slot}%}
  175.  
  176. if {_cena_wyswietlana} is not set:
  177. set {_cena_wyswietlana} to "&cBłąd ceny"
  178.  
  179. set {_lore::0} to ""
  180. set {_lore::1} to "&eKliknij &6LPM&e, aby zobaczyć drop!"
  181. set {_lore::2} to "&eKliknij &6PPM&e, aby otworzyć!"
  182. set {_lore::3} to ""
  183. set {_lore::4} to "&aCena otwarcia: &2$%{_cena_wyswietlana}%"
  184. set {_lore::5} to ""
  185.  
  186. set slot {_slot} of {_gui} to {_item} named {_nazwa} with lore {_lore::*}
  187.  
  188. set slot 31 of {_gui} to barrier named "&cPowrót"
  189. open {_gui} to player
  190.  
  191. # ==========================================
  192. # KLIKNIĘCIA W SKRZYNKI
  193. # ==========================================
  194.  
  195. on inventory click:
  196. if name of event-inventory is "&0Losowanie skinów":
  197. cancel event
  198. if clicked slot is 31:
  199. execute player command "cs-case menu"
  200. stop
  201.  
  202. if event-slot is not air:
  203. set {_slot} to index of event-slot
  204. if {skrzynki::przedmioty::%{_slot}%} is set:
  205.  
  206. # LPM - Podgląd
  207. if click type is left mouse button:
  208. open_drop_preview(player, {_slot})
  209.  
  210. # PPM - Otwieranie
  211. else if click type is right mouse button:
  212. set {_cena} to {skrzynki::cena::%{_slot}%}
  213.  
  214. if size of {skrzynki::drop::%{_slot}%::itemy::*} is 0:
  215. send "&cTa skrzynka jest pusta!" to player
  216. stop
  217. if {_cena} is not set:
  218. close player's inventory
  219. send "&4&lBŁĄD KONFIGURACJI CENY!" to player
  220. stop
  221.  
  222. set {_balans} to player's balance
  223. if {_balans} is not set:
  224. set {_balans} to 0
  225.  
  226. if {_balans} >= {_cena}:
  227. remove {_cena} from player's balance
  228. close player's inventory
  229. start_csgo_animation(player, {_slot})
  230. else:
  231. close player's inventory
  232. send "&cNie posiadasz wystarczającej ilości pieniędzy!" to player
  233.  
  234. if name of event-inventory contains "&0Otwieranie:":
  235. cancel event
  236.  
  237. # ==========================================
  238. # ANIMACJA I PODMIANA NAGRÓD (Z NOWYM SYSTEMEM FLOAT - LORE ONLY)
  239. # ==========================================
  240.  
  241. function start_csgo_animation(p: player, slot: integer):
  242. set {_p} to {_p}
  243.  
  244. # 1. Losowanie (Standardowe)
  245. set {_total_chance} to 0
  246. loop {skrzynki::drop::%{_slot}%::szanse::*}:
  247. add loop-value to {_total_chance}
  248.  
  249. set {_random} to random number between 0 and {_total_chance}
  250. set {_current_check} to 0
  251. set {_winner} to air
  252.  
  253. loop {skrzynki::drop::%{_slot}%::szanse::*}:
  254. add loop-value to {_current_check}
  255. if {_current_check} >= {_random}:
  256. set {_winner} to {skrzynki::drop::%{_slot}%::itemy::%loop-index%}
  257. stop loop
  258.  
  259. if {_winner} is air:
  260. set {_list::*} to {skrzynki::drop::%{_slot}%::itemy::*}
  261. set {_winner} to random element out of {_list::*}
  262.  
  263. # 2. GUI Animacji
  264. set {_gui_name} to colored {skrzynki::nazwy::%{_slot}%}
  265. set {_anim_gui} to chest inventory with 3 rows named "&0Otwieranie: %{_gui_name}%"
  266.  
  267. set {_glass} to black stained glass pane named "&8..."
  268. set slot 0 and 1 and 2 and 3 and 5 and 6 and 7 and 8 of {_anim_gui} to {_glass}
  269. set slot 18 and 19 and 20 and 21 and 23 and 24 and 25 and 26 of {_anim_gui} to {_glass}
  270.  
  271. set slot 4 of {_anim_gui} to hopper named "&6&l⬇ TWOJA NAGRODA ⬇"
  272. set slot 22 of {_anim_gui} to bedrock named "&6&l⬆ TWOJA NAGRODA ⬆"
  273.  
  274. set {_drops::*} to {skrzynki::drop::%{_slot}%::itemy::*}
  275. loop integers from 9 to 17:
  276. set slot loop-value of {_anim_gui} to random element out of {_drops::*}
  277.  
  278. open {_anim_gui} to {_p}
  279.  
  280. # 3. Pętla (Rolling)
  281. set {_speed} to 2
  282. set {_steps} to 0
  283. set {_total_steps} to 40
  284.  
  285. play sound "block.chest.open" with volume 1 and pitch 1 to {_p}
  286.  
  287. while {_steps} < {_total_steps}:
  288. add 1 to {_steps}
  289.  
  290. loop integers from 9 to 16:
  291. set {_next_item} to slot (loop-value + 1) of {_anim_gui}
  292. set slot loop-value of {_anim_gui} to {_next_item}
  293.  
  294. if {_steps} is ({_total_steps} - 4):
  295. set slot 17 of {_anim_gui} to {_winner}
  296. else:
  297. set slot 17 of {_anim_gui} to random element out of {_drops::*}
  298.  
  299. play sound "ui.button.click" with volume 0.5 and pitch 2 to {_p}
  300.  
  301. if {_steps} > 30:
  302. add 1 to {_speed}
  303. if {_steps} > 35:
  304. add 2 to {_speed}
  305.  
  306. wait "%{_speed}% ticks" parsed as timespan
  307.  
  308. if name of top inventory of {_p} is not "&0Otwieranie: %{_gui_name}%":
  309. stop loop
  310.  
  311. # 4. Sprawdzenie Złotej / Czerwonej nagrody
  312. set {_final_reward} to {_winner}
  313. set {_is_special} to false
  314.  
  315. # --- LOGIKA ZŁOTEGO DROPU ---
  316. if type of {_final_reward} is yellow candle:
  317. if size of {gold::pool::%{_slot}%::*} > 0:
  318. set {_final_reward} to random element out of {gold::pool::%{_slot}%::*}
  319. set {_is_special} to true
  320.  
  321. set {_display_name} to name of {_final_reward}
  322. if {_display_name} is not set:
  323. set {_display_name} to "%type of {_final_reward}%"
  324. set {_display_name} to "%{_display_name}%" in upper case
  325.  
  326. broadcast ""
  327. broadcast "&e&k| &6&lLEGENDARNY ZŁOTY DROP! &e&k|"
  328. broadcast "&eGracz &6%{_p}% &ewydropił &6%{_display_name}%&e!"
  329. broadcast "&eZe skrzynki: &f%{_gui_name}%"
  330. broadcast ""
  331. else:
  332. 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}
  333.  
  334. # --- LOGIKA CZERWONEGO DROPU ---
  335. else if type of {_final_reward} is red candle:
  336. set {_is_special} to true
  337.  
  338. set {_display_name} to name of {_final_reward}
  339. if {_display_name} is not set:
  340. set {_display_name} to "%type of {_final_reward}%"
  341. set {_display_name} to "%{_display_name}%" in upper case
  342.  
  343. broadcast ""
  344. broadcast "&c&k| &4&lMITYCZNY CZERWONY DROP! &c&k|"
  345. broadcast "&cGracz &4%{_p}% &cwydropił &4%{_display_name}%&c!"
  346. broadcast "&cZe skrzynki: &f%{_gui_name}%"
  347. broadcast ""
  348.  
  349. # 5. --- SYSTEM FLOAT (Lore + Nazwa) ---
  350. # Generujemy float od 0.0000 do 1.0000
  351. set {_float} to random number between 0.000000 and 1.000000
  352. set {_wear_status} to "&7Unknown"
  353.  
  354. # Określanie nazwy zużycia (standard CS:GO)
  355. if {_float} < 0.07:
  356. set {_wear_status} to "&bFactory New (FN)"
  357. else if {_float} < 0.15:
  358. set {_wear_status} to "&aMinimal Wear (MW)"
  359. else if {_float} < 0.38:
  360. set {_wear_status} to "&eField-Tested (FT)"
  361. else if {_float} < 0.45:
  362. set {_wear_status} to "&6Well-Worn (WW)"
  363. else:
  364. set {_wear_status} to "&cBattle-Scarred (BS)"
  365.  
  366. # Dodawanie Lore do przedmiotu (Tylko opis, bez niszczenia durability)
  367. add "" to lore of {_final_reward}
  368. add "&8&m------------------" to lore of {_final_reward}
  369. add "&7Stan: %{_wear_status}%" to lore of {_final_reward}
  370. add "&7Float: &8%{_float}%" to lore of {_final_reward}
  371. add "&8&m------------------" to lore of {_final_reward}
  372.  
  373. # 6. Finał i Tytuł
  374. set slot 13 of {_anim_gui} to {_final_reward}
  375.  
  376. if {_is_special} is true:
  377. play sound "ui.toast.challenge_complete" with volume 1 and pitch 1 to {_p}
  378. play sound "entity.wither.spawn" with volume 0.5 and pitch 1 to {_p}
  379. else:
  380. play sound "entity.player.levelup" with volume 1 and pitch 1 to {_p}
  381. play sound "entity.firework_rocket.large_blast" with volume 1 and pitch 1 to {_p}
  382.  
  383. set {_title_name} to name of {_final_reward}
  384. if {_title_name} is not set:
  385. set {_title_name} to "%type of {_final_reward}%"
  386. set {_title_name} to "%{_title_name}%" in upper case
  387.  
  388. send title "&6&lWYLOSOWANO!" with subtitle "&fOtrzymujesz: &e%{_title_name}%" to {_p} for 4 seconds
  389.  
  390. if {_is_special} is true:
  391. set {_win_glass} to yellow stained glass pane named "&6&lLEGENDARNA WYGRANA!"
  392. else:
  393. set {_win_glass} to lime stained glass pane named "&a&lWYGRANA!"
  394.  
  395. set slot 0 and 1 and 2 and 3 and 5 and 6 and 7 and 8 of {_anim_gui} to {_win_glass}
  396. set slot 18 and 19 and 20 and 21 and 23 and 24 and 25 and 26 of {_anim_gui} to {_win_glass}
  397.  
  398. wait 1.3 seconds
  399.  
  400. give {_final_reward} to {_p}
  401. close {_p}'s inventory
  402.  
  403. # ==========================================
  404. # FUNKCJE POMOCNICZE
  405. # ==========================================
  406.  
  407. function open_drop_preview(p: player, slot: integer):
  408. set {_nazwa} to colored {skrzynki::nazwy::%{_slot}%}
  409. set {_gui} to chest inventory with 4 rows named "&0Drop: %{_nazwa}%"
  410.  
  411. if size of {skrzynki::drop::%{_slot}%::itemy::*} is 0:
  412. set slot 13 of {_gui} to barrier named "&4&lBŁĄD!" with lore "&cTa skrzynka nie ma jeszcze" and "&cskonfigurowanego żadnego dropu!"
  413. else:
  414. set {_i} to 0
  415. loop {skrzynki::drop::%{_slot}%::itemy::*}:
  416. if {_i} < 36:
  417. set {_item} to loop-value
  418. set {_chance} to {skrzynki::drop::%{_slot}%::szanse::%loop-index%}
  419.  
  420. set slot {_i} of {_gui} to {_item} with lore "" and "&7Szansa: &a%{_chance}%%%" and ""
  421. add 1 to {_i}
  422.  
  423. set slot 31 of {_gui} to barrier named "&cPowrót"
  424. open {_gui} to {_p}
  425.  
  426. on inventory click:
  427. if name of event-inventory contains "&0Drop: ":
  428. cancel event
  429. if name of event-slot is "&cPowrót":
  430. execute player command "skrzynki"
  431.  
  432. # ==========================================
  433. # ADMIN: ZARZĄDZANIE SKRZYNKAMI I DROPEM
  434. # ==========================================
  435.  
  436. command /dodajskrzynke [<item>] [<text>] [<number>] [<integer>]:
  437. trigger:
  438. if player has permission "case.admin":
  439. if arg-1 or arg-2 or arg-3 or arg-4 is not set:
  440. send "&8&m──────&r &2&lSKRZYNKI &8&m──────" to player
  441. send "&2Użycie: &a/dodajskrzynke <przedmiot> <nazwa> <cena> <slot>" to player
  442. stop
  443.  
  444. set {_slot} to arg-4
  445. set {_cena} to arg-3
  446. set {_nazwa} to arg-2
  447. replace every "-" in {_nazwa} with " "
  448. set {skrzynki::przedmioty::%{_slot}%} to arg-1
  449. set {skrzynki::nazwy::%{_slot}%} to {_nazwa}
  450. set {skrzynki::cena::%{_slot}%} to {_cena}
  451. send "&aDodano skrzynkę na slot %{_slot}%." to player
  452.  
  453. else:
  454. send "&cNie posiadasz permisji!" to player
  455.  
  456. command /usunskrzynke [<integer>]:
  457. trigger:
  458. if player has permission "case.admin":
  459. if arg-1 is set:
  460. delete {skrzynki::przedmioty::%arg-1%}
  461. delete {skrzynki::nazwy::%arg-1%}
  462. delete {skrzynki::cena::%arg-1%}
  463. delete {skrzynki::drop::%arg-1%::itemy::*}
  464. delete {skrzynki::drop::%arg-1%::szanse::*}
  465. send "&cUsunięto skrzynkę ze slotu %arg-1%." to player
  466. else:
  467. send "&cPodaj slot."
  468. else:
  469. send "&cNie posiadasz permisji!"
  470.  
  471. command /dodajdrop [<text>] [<integer>]:
  472. trigger:
  473. if player has permission "case.admin":
  474. if arg-1 or arg-2 is not set:
  475. send "&6Użycie: &e/dodajdrop <szansa%%> <slot skrzynki>" to player
  476. send "&7Trzymaj w ręce przedmiot! Użyj &eYellow Candle &7dla Złotego, &cRed Candle &7dla Czerwonego." to player
  477. stop
  478.  
  479. if player's tool is air:
  480. send "&cMusisz trzymać przedmiot w ręce!" to player
  481. stop
  482.  
  483. set {_s} to arg-1
  484. replace all "," with "." in {_s}
  485. set {_szansa} to {_s} parsed as number
  486.  
  487. add player's tool to {skrzynki::drop::%arg-2%::itemy::*}
  488. add {_szansa} to {skrzynki::drop::%arg-2%::szanse::*}
  489.  
  490. send "&aDodano drop do skrzynki (slot %arg-2%) z szansą %{_szansa}%%%." to player
  491. else:
  492. send "&cNie posiadasz permisji!" to player
  493.  
  494. command /usundrop [<integer>]:
  495. permission: case.admin
  496. trigger:
  497. if arg-1 is set:
  498. delete {skrzynki::drop::%arg-1%::itemy::*}
  499. delete {skrzynki::drop::%arg-1%::szanse::*}
  500. send "&cWyczyszczono drop ze skrzynki %arg-1%." to player
  501. else:
  502. send "&cUżycie: &4/usundrop <slot>" to player
  503.  
  504. on first join:
  505. set {kasa::%player%} to 0
Advertisement
Add Comment
Please, Sign In to add comment