Skocz do zawartości
  • 0

Wypadanie czesci itemow z graczy po smierci.


Pytanie

Witam

Czy mógłby mi ktoś napisać skrypt na wersje 1.16.1, że po śmierci gracza wypada z niego 10% jego losowych itemów, a reszta zostaje mu w ekwipunku (Taki skrypt znajduje się na kwadratowej masakrze).

Z góry dzięki.

Odnośnik do komentarza
https://skript.pl/temat/40494-wypadanie-czesci-itemow-z-graczy-po-smierci/
Udostępnij na innych stronach

5 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
on death:
    if victim is player:
        set {_a} to random integer between 1 and 36
        set {_b} to random integer between 1 and 36
        set {_c} to random integer between 1 and 36
        set {_d} to random integer between 1 and 36
        while {_a} is {_b} or {_c} or {_d}:
            set {_a} to random integer between 1 and 36
        while {_b} is {_a} or {_c} or {_d}:
            set {_b} to random integer between 1 and 36
        while {_c} is {_b} or {_a} or {_d}:
            set {_c} to random integer between 1 and 36
        while {_d} is {_b} or {_c} or {_a}:
            set {_d} to random integer between 1 and 36
        set {_i1} to slot {_a} of victim
        drop {_i1} at victim
        set slot {_a} of player to air
        set {_i2} to slot {_b} of victim
        drop {_i2} at victim
        set slot {_b} of player to air
        set {_i3} to slot {_c} of victim
        drop {_i3} at victim
        set slot {_c} of player to air
        set {_i4} to slot {_d} of victim
        drop {_i4} at victim
        set slot {_d} of player to air

Może coś takiego? 🤔
Do tego musisz mieć keepInventory (/gamerule keepInventory true)

Odnośnik do komentarza
https://skript.pl/temat/40494-wypadanie-czesci-itemow-z-graczy-po-smierci/#findComment-253226
Udostępnij na innych stronach

  • 0
47 minut temu, Kub0wskyyy napisał:

Działa dobrze, lecz nigdy po smierci nie wypada z gracza jego zalozony set oraz gdy ktos ma mniej niz 36 itemow to nie wypada wtedy z niego 10% jego itemow.

on death:
  if victim is player:
    set {_loc} to location of victim
    set {_x} to 0
    loop 39 times:
      if slot {_x} of victim is not air:
        add {_x} to {_sloty::*}
      add 1 to {_x}
    set {_ilosc} to size of {_sloty::*}
    set {_ilosc} to (10 * {_ilosc}) / 100
    set {_ilosc} to rounded up {_ilosc}
    loop {_ilosc} times:
      set {_i} to "%random element out of {_sloty::*}%"
      remove {_i} from {_sloty::*}
      set {_item} to slot ({_i} parsed as integer) of victim
      add {_item} to {_dropy::*}
      drop {_item} at {_loc}
      set slot ({_i} parsed as integer) of victim to air
      send "%{_i}%" to victim

To może coś takiego? 🤔

Odnośnik do komentarza
https://skript.pl/temat/40494-wypadanie-czesci-itemow-z-graczy-po-smierci/#findComment-253236
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...