Skocz do zawartości
  • 0

Case Opening


ejer
 Udostępnij

Pytanie

Spoiler
options:
        tag: &8[&6Case&8]z
        chance key: 5
        chance chest: 10
 
method "edit" {player and case}:
        set {_player} to arg{1};
        set {_case} to arg{2};
        open chest with 3 rows named "&6Edytujesz: &c%{_case}%" to {_player}
        wait 1 tick
        set {_slot} to 0
        loop {case::%{_case}%::itemlist::*}:
                set slot {_slot} of current inventory of {_player} to loop-value
                add 1 to {_slot}
        set {case::player::%{_player}%::openedit} to "%{_case}%"
        command /setsw:
        permission: sad to {_player}
        while inventory name of {_player} is "&6Edytujesz: &c%{_case}%":
                set {case::player::%{_player}%::openedit} to "%{_case}%"
                wait 5 tick
method "list" {player}:
        set {_player} to arg{1};
        open chest with 6 rows named "&6Lista skrzynek:" to {_player}
        wait 1 tick
        loop {case::chestlist::*}:
                set {_case%loop-index%} to loop-value
                if {_case%loop-index%} contains "<none>":
                        remove loop-value from {case::chestlist::*}
                        delete {_case%loop-index%}
        loop (size of {case::chestlist::*}) times:
                set {_lore} to "%{case::%{_case%loop-number%}%::itemlist::*}%"
                replace all ", " with "|| &8- &c" in {_lore}
                replace all "and " with "|| &8- &c" in {_lore}
                format slot loop-number - 1 of {_player} with 1 of chest named "&6%{_case%loop-number%}%" with lore " || &6W tej skrzyni mozesz zdobyc: || || &8- &c%{_lore}% || " to close
method "opening" {player and case}:
        set {_player} to arg{1};
        set {_case} to arg{2};
        if {case::player::%{_player}%::openwait} is true:
                send "{@tag} &7Juz otwierasz skrzynie!" to {_player}
        else:
                set {_size} to size of {case::%{_case}%::itemlist::*}
                if {_size} > 0:
                        remove 1 tripwire hook named "&6Klucz do skrzyni &c%{_case}%" from {_player}'s inventory
                        set {_lore} to "%{case::%{_case}%::itemlist::*}%"
                        replace all ", " with "|| &8- &c" in {_lore}
                        replace all "and " with "|| &8- &c" in {_lore}
                        remove 1 chest named "&6%{_case}%" with lore " || &6W tej skrzyni mozesz zdobyc: || || &8- &c%{_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 "&6Skrzynia &c%{_case}%" to {_player}
                        wait 1 tick
                        loop {case::%{_case}%::itemlist::*}:
                                set {_skin%loop-index%} to loop-value
                        loop (size of {case::%{_case}%::itemlist::*}) times:
                                format slot loop-number + 26 of {_player} with 1 of {_skin%loop-number%} to be unstealable
                        loop 9 times:
                                set {_item%loop-number%} to random element out of {case::%{_case}%::itemlist::*}
                                format slot loop-number + 8 of {_player} with 1 of {_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 {_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 1 of {_item%loop-number-2%} to be unstealable
                                set {_item9} to random element out of {case::%{_case}%::itemlist::*}
                                if {case::player::%{_player}%::open} is true:
                                        format slot 17 of {_player} with 1 of {_item9} to be unstealable
                        set {case::player::%{_player}%::open} to false
                        wait 3 seconds
                        open chest with 1 rows named "&6Wygrales:" to {_player}
                        send "{@tag} &7Odbierz swoja nagrode." to {_player}
                        wait 1 tick
                        set slot 4 of current inventory of {_player} to {_item5}
                        play raw sound "mob.endermen.portal" at {_player} with pitch 0.1 volume 1
                        set {case::player::%{_player}%::openwait} to false
                else:
                        send "{@tag} &7W tej skrzyni nie mozna nic wylosowac!" to {_player}
command /case [<text="null">] [<text>] [<text>]:
        trigger:
                if player has permission "case.*":
                        if arg 1 is not "add" or "remove" or "edit" or "give" or "list" or "method":
                                send "{@tag}"
                                send "&6/case add <name> &8- &7Dodaje nowa skrzynke."
                                send "&6/case remove <name> &8- &7Usuwa skrzynke."
                                send "&6/case edit <name> &8- &7Edytuje zawartosc skrzyni."
                                send "&6/case give <name> <player> &8- &7Daje nam klucz i skrzynie."
                                send "&6/case list &8- &7Lista skrzyn w gui."
                        if arg 1 is "add":
                                if arg 2 is set:
                                        loop {case::chestlist::*}:
                                                if loop-value is arg 2:
                                                        send "{@tag} &7Taka skrzynia juz istnieje!"
                                                        stop
                                        add arg 2 to {case::chestlist::*}
                                        send "{@tag} &7Dodano skrzynie o nazwie &6%arg 2%&7."
                                else:
                                        send "&6/case add <name>"
                        if arg 1 is "remove":
                                if arg 2 is set:
                                        loop {case::chestlist::*}:
                                                if loop-value is arg 2:
                                                        remove arg 2 from {case::chestlist::*}
                                                        delete {case::%arg 2%::itemlist::*}
                                                        send "{@tag} &7Usunieto skrzynie o nazwie &6%arg 2%&7."
                                                        stop
                                        send "{@tag} &7Taka skrzynia nie istnieje!"
                                else:
                                        send "&6/case remove <name>"
                        if arg 1 is "edit":
                                if arg 2 is set:
                                        loop {case::chestlist::*}:
                                                if loop-value is arg 2:
                                                        function "edit" {player and arg 2}
                                                        stop
                                        send "{@tag} &7Taka skrzynia nie istnieje!"
                                else:
                                        send "&6/case additem <name>"
                        if arg 1 is "give":
                                if arg 2 is set:
                                        loop {case::chestlist::*}:
                                                if loop-value is arg 2:
                                                        if arg 3 is set:
                                                                set {_player} to arg 3 parsed as offlineplayer
                                                        else:
                                                                set {_player} to player
                                                        if {_player} is online:
                                                                set {_lore} to "%{case::%arg 2%::itemlist::*}%"
                                                                replace all ", " with "|| &8- &c" in {_lore}
                                                                replace all "and " with "|| &8- &c" in {_lore}
                                                                add 64 chest named "&6%arg 2%" with lore " || &6W tej skrzyni mozesz zdobyc: || || &8- &c%{_lore}% || " to {_player}'s inventory
                                                                add 64 tripwire hook named "&6Klucz do skrzyni &c%arg 2%" to {_player}'s inventory
                                                                stop
                                        send "{@tag} &7Taka skrzynia nie istnieje!"
                                else:
                                        send "&6/case givechest <name>"
                        if arg 1 is "list":
                                function "list" {player};
                if arg 1 is "method":
                        set {_player} to arg 3 parsed as player
                        if {_player}'s inventory contains tripwire hook named "&6Klucz do skrzyni &c%arg 2%":
                                set {_lore} to "%{case::%arg 2%::itemlist::*}%"
                                replace all ", " with "|| &8- &c" in {_lore}
                                replace all "and " with "|| &8- &c" in {_lore}
                                if {_player}'s inventory contains chest named "&6%arg 2%" with lore " || &6W tej skrzyni mozesz zdobyc: || || &8- &c%{_lore}% || ":
                                        function "opening" {{_player} and arg 2};
                                else:
                                        send "{@tag} &7Nie posiadasz tej skrzyni!" to {_player}
                        else:
                                send "{@tag} &7Nie posiadasz klucza do tej skrzyni!" to {_player}
on inventory close:
        if {case::player::%player%::open} is true:
                set {case::player::%player%::open} to false
                send "{@tag} &7Zamknieto 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} &7Zapisano."
on quit:
        if {case::player::%player%::open} is true:
                set {case::player::%player%::open} to false
on death:
        if {case::player::%victim%::open} is true:
                set {case::player::%victim%::open} to false
on right click:
        if player's tool is chest:
                loop {case::chestlist::*}:
                        if loop-value is uncolored name of player's tool:
                                cancel event
                                set {_lore} to "%{case::%loop-value%::itemlist::*}%"
                                replace all ", " with "|| &8- &c" in {_lore}
                                replace all "and " with "|| &8- &c" in {_lore}
                                set lore of player's tool to " || &6W tej skrzyni mozesz zdobyc: || || &8- &c%{_lore}% || "
                                execute player command "case method %uncolored name of player's tool% %player%"
        if player's tool is tripwire hook:
                if name of player's tool contains "Klucz do skrzyni":
                        cancel event
                        function "list" {player};
on mine of stone:
        chance of {@chance chest}%:
                set {_element} to random element out of {case::chestlist::*}
                set {_lore} to "%{case::%{_element}%::itemlist::*}%"
                replace all ", " with "|| &8- &c" in {_lore}
                replace all "and " with "|| &8- &c" in {_lore}
                drop chest named "&6%{_element}%" with lore " || &6W tej skrzyni mozesz zdobyc: || || &8- &c%{_lore}% || "
                play raw sound "mob.endermen.portal" at player with pitch 0.001 volume 1
                send "{@tag} &7Zdobyles skrzynie &6%{_element}%&7!"
        chance of {@chance key}%:
                set {_element} to random element out of {case::chestlist::*}
                drop tripwire hook named "&6Klucz do skrzyni &c%{_element}%"
                play raw sound "mob.endermen.portal" at player with pitch 0.001 volume 1
                send "{@tag} &7Zdobyles klucz do skrzyni &6%{_element}%&7!"

 

Wywala błąd:

[09:38:41 INFO]: [Skript] Reloading CaseOpen.sk...
[09:38:41 WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (CaseOpen.sk, line 19: command /setsw:')
[09:38:41 ERROR]: '"edit" {player and case}' is not a text (CaseOpen.sk, line 9: method "edit" {player and case}:')
[09:38:41 ERROR]: '"list" {player}' is not a text (CaseOpen.sk, line 24: method "list" {player}:')
[09:38:41 ERROR]: '"opening" {player and case}' is not a text (CaseOpen.sk, line 38: method "opening" {player and case}:')
[09:38:41 ERROR]: 'player and' is not a type (CaseOpen.sk, line 126: function "edit" {player and arg 2}')
[09:38:41 ERROR]: Can't understand this condition/effect: function "list" {player}; (CaseOpen.sk, line 150: function "list" {player};')
[09:38:41 ERROR]: Can't understand this condition/effect: function "opening" {{_player} and arg 2}; (CaseOpen.sk, line 158: function "opening" {{_player} and arg 2};')
[09:38:42 ERROR]: Can't understand this condition/effect: function "list" {player}; (CaseOpen.sk, line 194: function "list" {player};')
[09:38:42 INFO]: [Skript] Encountered 7 errors while reloading CaseOpen.sk!
 
//Spoiler ~bvcz
Odnośnik do komentarza
Udostępnij na innych stronach

4 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

ejer musisz pokazać cały skrypt żeby można było sb ogarnąć jak działa

 

Dnia 1.11.2016 o 10:19, ejer napisał:

Spigot 1.7.x - 1.8.x

 

oraz jaką masz ver skript

 

oraz musisz posiadać wild skript itp

 

dobra zobaczyłem skrypt i informuje iż takie minki jak ;) ;( :<  itp. nie działają

//quadra post! ~ :boleknowak:

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
22 godziny temu, Nik3N napisał:

ejer musisz pokazać cały skrypt żeby można było sb ogarnąć jak działa

 

oraz jaką masz ver skript

 

oraz musisz posiadać wild skript itp

 

dobra zobaczyłem skrypt i informuje iż takie minki jak ;) ;( :<  itp. nie działają

//quadra post! ~ :boleknowak:

Pokazałem cały...

Nie wiem jak sprawdzić wersje sk

posiadam wszystkie potrzebne dodatki

co to ostatniego to nie rozumiem o co ci chodzi

Odnośnik do komentarza
Udostępnij na innych stronach

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ę...