Skocz do zawartości
  • 0

Sk na skrzynie problem


Posejdon54111
 Udostępnij

Pytanie

Czy mógł mi by ktoś przerobic ze jak jest skrzynka to wtedy jak na nią najade to tam jest Wielki spam w dół jakie itemy z niej dropia a ja chce że np 6 itemów tam pokazuje i dalej to np 23 inne 

Spoiler

# Author: Nawo
# Dev: Enxi

variables:
    {case::player::%player%::open} = false
    {case::player::%player%::openwait} = false

options:
    
    # General
    
    tag: &8[&6Case&8] # Przedrostek wiadomosci
    
    # Drop case
    
    chance drop key: 2,5% # Szansa na wykopanie klucza podana w procentach
    chance drop chest: 5% # Szansa na wykopanie skrzyni podana w procentach
    block drop: stone or dirt or gravel or obsidian # Z jakiego bloku mozna wykopac skrzynie/klucz
    
    chance death key: 2,5% # Szansa na wypadniecie klucza po zabiciu gracza
    chance death chest: 5% # Szansa na wypadniecie skrzyni po zabiciu gracza
    
    # Colour message:
    
    important: &6
    general: &7
    leere: &8
    
    lore: &c
    
command /case [<text="help">] [<text>] [<text>] [<text>]:
    executable by: players and console
    trigger:
        if player has permission "case.*":
            if arg 1 is "help":
                send "{@tag}"
                send "{@important}/case add <name> <type> {@leere}- {@general}Dodaje nowa skrzynke."
                send "{@important}/case remove <name> {@leere}- {@general}Usuwa skrzynke."
                send "{@important}/case edit <name> {@leere}- {@general}Edytuje zawartosc skrzyni."
                send "{@important}/case give <name> [<player/all>] [<number>] {@leere}- {@general}Daje nam klucz i skrzynie."
                send "{@important}/case list {@leere}- {@general}Lista skrzyn w gui."
                send "{@important}/case stats [<player>] {@leere}- {@general}Statystyki gracza."
                send "{@important}/case open <name> [<player>] {@leere}- {@general}Otwiera skrzynie."
            if arg 1 is "add":
                if arg 2 is set:
                    set {_name} to arg 2
                    replace all "_" with " " in {_name}
                    loop {case::chestlist::*}:
                        if loop-value is {_name}:
                            send "{@tag} {@general}Taka skrzynia juz istnieje!"
                            stop
                    if arg 3 is set:
                        if arg 3 is "key" or "notkey":
                            add {_name} to {case::chestlist::*}
                            send "{@tag} {@general}Dodano skrzynie o nazwie {@important}%{_name}%{@general}."
                            if arg 3 is "key":
                                set {case::type::%{_name}%} to "key"
                                send "{@tag} {@general}Skrzynia wymaga klucza."
                            if arg 3 is "notkey":
                                set {case::type::%{_name}%} to "notkey"
                                send "{@tag} {@general}Skrzynia nie wymaga klucza."
                        else:
                            send "{@tag} {@important}/case add <name> <type=""key""or""notkey""> "
                    else:
                        send "{@tag} {@important}/case add <name> <type=""key""or""notkey""> "    
                else:
                    send "{@tag} {@important}/case add <name> <type=""key""or""notkey""> "
            if arg 1 is "remove":
                if arg 2 is set:
                    set {_name} to arg 2
                    replace all "_" with " " in {_name}
                    loop {case::chestlist::*}:
                        if loop-value is {_name}:
                            remove {_name} from {case::chestlist::*}
                            delete {case::%{_name}%::itemlist::*}
                            delete {case::type::%{_name}%}
                            send "{@tag} {@general}Usunieto skrzynie o nazwie {@important}%{_name}%{@general}."
                            stop
                    send "{@tag} {@general}Taka skrzynia nie istnieje!"
                else:
                    send "{@tag} {@important}/case remove <name>"
            if arg 1 is "edit":
                if arg 2 is set:
                    set {_name} to arg 2
                    replace all "_" with " " in {_name}
                    loop {case::chestlist::*}:
                        if loop-value is {_name}:
                            open chest with 3 rows named "{@important}Edytujesz: {@lore}%{_name}%" to player
                            wait 1 tick
                            set {_slot} to 0
                            loop {case::%{_name}%::itemlist::*}:
                                set slot {_slot} of current inventory of player to loop-value-2
                                add 1 to {_slot}
                            set {case::player::%player%::openedit} to "%{_name}%"
                            send "{@tag} {@general}Edytujesz zawartosc skrzyni {@important}%{_name}%{@general}." to player
                            while inventory name of player is "{@important}Edytujesz: {@lore}%{_name}%":
                                set {case::player::%player%::openedit} to "%{_name}%"
                                wait 1 second
                            stop
                    send "{@tag} {@general}Taka skrzynia nie istnieje!"
                else:
                    send "{@tag} {@important}/case additem <name>"
            if arg 1 is "give":
                if arg 2 is set:
                    set {_name} to arg 2
                    replace all "_" with " " in {_name}
                    loop {case::chestlist::*}:
                        if loop-value is {_name}:
                            set {_lore} to "%{case::%{_name}%::itemlist::*}%"
                            replace all ", " with "|| {@leere}- {@lore}" in {_lore}
                            replace all "and " with "|| {@leere}- {@lore}" in {_lore}
                            if arg 3 is set:
                                if arg 4 is set:
                                    set {_number} to arg 4 parsed as integer
                                else:
                                    set {_number} to 64
                                if arg 3 is "all":
                                    loop all players:
                                        if {case::type::%{_name}%} is "key":
                                            add {_number} of chest named "{@important}%{_name}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " to loop-player's inventory
                                            add {_number} of tripwire hook named "{@important}Klucz do skrzyni {@lore}%{_name}%" to loop-player's inventory
                                        else if {case::type::%{_name}%} is "notkey":
                                            add {_number} of ender chest named "{@important}%{_name}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " to loop-player's inventory
                                if arg 3 is not "all":
                                    set {_player} to arg 3 parsed as offlineplayer
                                    if {case::type::%{_name}%} is "key":
                                        add {_number} of chest named "{@important}%{_name}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " to {_player}'s inventory
                                        add {_number} of tripwire hook named "{@important}Klucz do skrzyni {@lore}%{_name}%" to {_player}'s inventory
                                    else if {case::type::%{_name}%} is "notkey":
                                        add {_number} of ender chest named "{@important}%{_name}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " to {_player}'s inventory
                            else:
                                if {case::type::%{_name}%} is "key":
                                    add 64 of chest named "{@important}%{_name}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " to player's inventory
                                    add 64 of tripwire hook named "{@important}Klucz do skrzyni {@lore}%{_name}%" to player's inventory
                                else:
                                    add 64 of ender chest named "{@important}%{_name}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " to player's inventory
                            stop
                    send "{@tag} {@general}Taka skrzynia nie istnieje!"
                else:
                    send "{@tag} {@important}/case give <name> [<type=""%%player%%""or""all"">] [<number>]"
            if arg 1 is "list":
                open chest with 6 rows named "{@important}Lista skrzynek:" to player
                wait 1 tick
                set {_slot} to 0
                loop {case::chestlist::*}:
                    if loop-value contains "<none>":
                        remove loop-value from {case::chestlist::*}
                    set {_lore} to "%{case::%loop-value%::itemlist::*}%"
                    set {_name%loop-index%} to loop-value
                    replace all ", " with "|| {@leere}- {@lore}" in {_lore}
                    replace all "and " with "|| {@leere}- {@lore}" in {_lore}
                    replace all " " with "_" in {_name%loop-index%}
                    if {case::type::%loop-value%} is "key":
                        format slot {_slot} of player with 1 of chest named "{@important}%loop-value%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " to run [close player's inventory]->[wait 2 tick]->[execute player command "case open %{_name%{_slot}%}%"]
                    else:
                        format slot {_slot} of player with 1 of ender chest named "{@important}%loop-value%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " to run [close player's inventory]->[wait 2 tick]->[execute player command "case open %{_name%{_slot}%}%"]
                    add 1 to {_slot}
                    wait 1 tick
            if arg 1 is "stats":
                if arg 2 is set:
                    set {_player} to arg 2 parsed as player
                else:
                    set {_player} to player
                send "{@tag} {@general}Otworzone skrzynie gracza {@important}%{_player}%{@general}:"
                loop {case::chestlist::*}:
                    if {case::player::%{_player}%::stats::%loop-value%} is set:
                        send " {@important}%loop-value%{@leere}: {@general}%{case::player::%{_player}%::stats::%loop-value%}%"
                    else:
                        send " {@important}%loop-value%{@leere}: {@general}0"
        if arg 1 is "open":
            if arg 2 is set:
                if arg 3 is set:
                    if player has permission "case.*":
                        set {_player} to arg 3 parsed as player
                    else:
                        send "{@tag} {@general}Nie posiadasz uprawnien!"
                else:
                    set {_player} to player
                set {_name} to arg 2
                replace all "_" with " " in {_name}
                loop {case::chestlist::*}:
                    if loop-value is {_name}:
                        set {_lore} to "%{case::%loop-value%::itemlist::*}%"
                        replace all ", " with "|| {@leere}- {@lore}" in {_lore}
                        replace all "and " with "|| {@leere}- {@lore}" in {_lore}
                        set lore of player's tool to " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || "
                        if {case::type::%{_name}%} is "key":
                            if {_player}'s inventory contains tripwire hook named "{@important}Klucz do skrzyni {@lore}%{_name}%":
                                if {_player}'s inventory contains chest named "{@important}%{_name}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || ":
                                    if {case::player::%{_player}%::openwait} is true:
                                        send "{@tag} {@general}Juz otwierasz skrzynie!" to {_player}
                                    else:
                                        if (size of {case::%{_name}%::itemlist::*}) > 0:
                                            add 1 to {case::player::%{_player}%::stats::%{_name}%}
                                            remove 1 tripwire hook named "{@important}Klucz do skrzyni {@lore}%{_name}%" from {_player}'s inventory
                                            remove 1 chest named "{@important}%{_name}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " from {_player}'s inventory
                                            set {case::player::%{_player}%::open} to true
                                            set {case::player::%{_player}%::openwait} to true
                                            open chest with 6 rows named "{@important}Skrzynia {@lore}%{_name}%" to {_player}
                                            wait 1 tick
                                            loop 9 times:
                                                set {_item%loop-number%} to random element out of {case::%{_name}%::itemlist::*}
                                                format slot loop-number + 8 of {_player} with {_item%loop-number%} to be unstealable
                                                format slot loop-number - 1 of {_player} with 1 of black stained glass pane to be unstealable
                                                format slot loop-number + 17 of {_player} with 1 of black stained glass pane to be unstealable
                                            format slot 4 of {_player} with 1 of hopper to be unstealable
                                            set {_slot} to 0
                                            loop {case::%{_name}%::itemlist::*}:
                                                if {case::player::%{_player}%::open} is true:
                                                    add 1 to {_slot}
                                                    format slot {_slot} + 26 of {_player} with loop-value-2 to be unstealable
                                                    wait 1 tick
                                            set {_random} to random integer between 20 and 30
                                            wait 1 seconds
                                            loop {_random} times:
                                                if loop-number > 15:
                                                    loop loop-number - 12 times:
                                                        wait 1 tick
                                                else:
                                                    wait 3 tick
                                                play raw sound "mob.skeleton.death" at {_player} with pitch 8 volume 1
                                                loop 8 times:
                                                    set {_item%loop-number-2%} to {_item%loop-number-2 + 1%}
                                                    if {case::player::%{_player}%::open} is true:
                                                        format slot loop-number-2 + 8 of {_player} with {_item%loop-number-2%} to be unstealable
                                                set {_item9} to random element out of {case::%{_name}%::itemlist::*}
                                                if {case::player::%{_player}%::open} is true:
                                                    format slot 17 of {_player} with {_item9} to be unstealable
                                            wait 3 seconds
                                            set {case::player::%{_player}%::open} to false
                                            broadcast "{@tag} {@general}Gracz {@important}%{_player}% {@general}wylosowal {@important}%{_item5}% {@general}ze skrzyni {@important}%{_name}%{@general}. Gratulacje!"
                                            launch flickering trailing ball firework colored green at {_player} timed 1
                                            add {_item5} to {_player}'s inventory
                                            play raw sound "mob.endermen.portal" at {_player} with pitch 0.1 volume 1
                                            set {case::player::%{_player}%::openwait} to false
                                            close player's inventory
                                        else:
                                            send "{@tag} {@general}W tej skrzyni nie mozna nic wylosowac!" to {_player}
                                else:
                                    send "{@tag} {@general}Nie posiadasz tej skrzyni!" to {_player}
                            else:
                                send "{@tag} {@general}Nie posiadasz klucza do tej skrzyni!" to {_player}
                        else:
                            if {_player}'s inventory contains ender chest named "{@important}%{_name}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || ":
                                if {case::player::%{_player}%::openwait} is true:
                                    send "{@tag} {@general}Juz otwierasz skrzynie!" to {_player}
                                else:
                                    if (size of {case::%{_name}%::itemlist::*}) > 0:
                                        add 1 to {case::player::%{_player}%::stats::%{_name}%}
                                        remove 1 ender chest named "{@important}%{_name}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " from {_player}'s inventory
                                        set {case::player::%{_player}%::open} to true
                                        set {case::player::%{_player}%::openwait} to true
                                        open chest with 6 rows named "{@important}Skrzynia {@lore}%{_name}%" to {_player}
                                        wait 1 tick
                                        loop 9 times:
                                            set {_item%loop-number%} to random element out of {case::%{_name}%::itemlist::*}
                                            format slot loop-number + 8 of {_player} with {_item%loop-number%} to be unstealable
                                            format slot loop-number - 1 of {_player} with 1 of black stained glass pane to be unstealable
                                            format slot loop-number + 17 of {_player} with 1 of black stained glass pane to be unstealable
                                        format slot 4 of {_player} with 1 of hopper to be unstealable
                                        set {_slot} to 0
                                        loop {case::%{_name}%::itemlist::*}:
                                            if {case::player::%{_player}%::open} is true:
                                                add 1 to {_slot}
                                                format slot {_slot} + 26 of {_player} with loop-value-2 to be unstealable
                                                wait 1 tick
                                        set {_random} to random integer between 20 and 30
                                        wait 1 seconds
                                        loop {_random} times:
                                            if loop-number > 15:
                                                loop loop-number - 12 times:
                                                    wait 1 tick
                                            else:
                                                wait 3 tick
                                            play raw sound "mob.skeleton.death" at {_player} with pitch 8 volume 1
                                            loop 8 times:
                                                set {_item%loop-number-2%} to {_item%loop-number-2 + 1%}
                                                if {case::player::%{_player}%::open} is true:
                                                    format slot loop-number-2 + 8 of {_player} with {_item%loop-number-2%} to be unstealable
                                            set {_item9} to random element out of {case::%{_name}%::itemlist::*}
                                            if {case::player::%{_player}%::open} is true:
                                                format slot 17 of {_player} with {_item9} to be unstealable
                                        wait 3 seconds
                                        set {case::player::%{_player}%::open} to false
                                        broadcast "{@tag} {@general}Gracz {@important}%{_player}% {@general}wylosowal {@important}%{_item5}% {@general}ze skrzyni {@important}%{_name}%{@general}. Gratulacje!"
                                        launch flickering trailing ball firework colored green at {_player} timed 1
                                        add {_item5} to {_player}'s inventory
                                        play raw sound "mob.endermen.portal" at {_player} with pitch 0.1 volume 1
                                        set {case::player::%{_player}%::openwait} to false
                                        close player's inventory
                                    else:
                                        send "{@tag} {@general}W tej skrzyni nie mozna nic wylosowac!" to {_player}
                            else:
                                send "{@tag} {@general}Nie posiadasz tej skrzyni!" to {_player}
                        stop
                send "{@tag} {@general}Taka skrzynia nie istnieje!" to {_player}
on inventory click:
    if {case::player::%player%::open} is true:
        cancel event
on inventory close:
    if {case::player::%player%::open} is true:
        set {case::player::%player%::open} to false
        send "{@tag} {@general}Zamknieto podglad losowania."
    if {case::player::%player%::openedit} is set:
        clear {case::%{case::player::%player%::openedit}%::itemlist::*}
        loop 27 times:
            if slot "%loop-number - 1%" parsed as an integer of current inventory of player is not air:
                set {_item} to slot loop-number - 1 of current inventory of player
                add {_item} to {case::%{case::player::%player%::openedit}%::itemlist::*}
        clear {case::player::%player%::openedit}
        send "{@tag} {@general}Zapisano."
on quit:
    set {case::player::%player%::open} to false
    set {case::player::%player%::openwait} to false
    clear {case::player::%player%::openedit}
on death:
    set {case::player::%victim%::open} to false
    set {case::player::%victim%::openwait} to false
    clear {case::player::%player%::openedit}
    if attacker is a player:
        chance of {@chance death chest}:
            set {_element} to random element out of {case::chestlist::*}
            set {_lore} to "%{case::%{_element}%::itemlist::*}%"
            replace all ", " with "|| {@leere}- {@lore}" in {_lore}
            replace all "and " with "|| {@leere}- {@lore}" in {_lore}
            if {case::type::%{_element}%} is "key":
                drop chest named "{@important}%{_element}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " at location of victim
            else:
                drop ender chest named "{@important}%{_element}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " at location of victim
        chance of {@chance death key}:
            set {_element} to random element out of {case::chestlist::*}
            if {case::type::%{_element}%} is "notkey":
                drop tripwire hook named "{@important}Klucz do skrzyni {@lore}%{_element}%" at location of victim
on right click:
    if player's tool is chest or ender chest:
        loop {case::chestlist::*}:
            if uncolored name of player's tool is loop-value:
                cancel event
                set {_name} to uncolored name of player's tool
                replace all " " with "_" in {_name}
                execute player command "case open %{_name}%"
                stop
    if player's tool is tripwire hook:
        if name of player's tool contains "Klucz do skrzyni":
            cancel event
            open chest with 6 rows named "{@important}Lista skrzynek:" to player
            wait 1 tick
            set {_slot} to 0
            loop {case::chestlist::*}:
                if loop-value contains "<none>":
                    remove loop-value from {case::chestlist::*}
                set {_lore} to "%{case::%loop-value%::itemlist::*}%"
                set {_name%loop-index%} to loop-value
                replace all ", " with "|| {@leere}- {@lore}" in {_lore}
                replace all "and " with "|| {@leere}- {@lore}" in {_lore}
                replace all " " with "_" in {_name%loop-index%}
                if {case::type::%loop-value%} is "key":
                    format slot {_slot} of player with 1 of chest named "{@important}%loop-value%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " to run [close player's inventory]->[wait 2 tick]->[execute player command "case open %{_name%{_slot}%}%"]
                else:
                    format slot {_slot} of player with 1 of ender chest named "{@important}%loop-value%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || " to run [close player's inventory]->[wait 2 tick]->[execute player command "case open %{_name%{_slot}%}%"]
                add 1 to {_slot}
                wait 1 tick
on mine of {@block drop}:
    chance of {@chance drop chest}:
        set {_element} to random element out of {case::chestlist::*}
        set {_lore} to "%{case::%{_element}%::itemlist::*}%"
        replace all ", " with "|| {@leere}- {@lore}" in {_lore}
        replace all "and " with "|| {@leere}- {@lore}" in {_lore}
        if {case::type::%{_element}%} is "key":
            drop chest named "{@important}%{_element}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || "
        else:
            drop ender chest named "{@important}%{_element}%" with lore " || {@important}W tej skrzyni mozesz zdobyc: || || {@leere}- {@lore}%{_lore}% || "
        play raw sound "mob.endermen.portal" at player with pitch 0.001 volume 1
        send "{@tag} {@general}Zdobyles skrzynie {@important}%{_element}%{@general}!"
    chance of {@chance drop key}:
        set {_element} to random element out of {case::chestlist::*}
        if {case::type::%{_element}%} is "key":
            drop tripwire hook named "{@important}Klucz do skrzyni {@lore}%{_element}%"
            play raw sound "mob.endermen.portal" at player with pitch 0.001 volume 1
            send "{@tag} {@general}Zdobyles klucz do skrzyni {@important}%{_element}%{@general}!"

Tu daje sk na te skrzynie

Odnośnik do komentarza
Udostępnij na innych stronach

0 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

Nie udzielono jeszcze odpowiedzi na to pytanie

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

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