Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Version: 1.0 Beta
- #Author: Shooterowy
- options:
- tag: &a[&6Player&4Hunt&a] #Tag skryptu
- min_lore_length: 35 #Minimalna dlugosc opisu zlecenia
- command /playerhunt [<text="zlecenia">] [<text>]:
- aliases: phunt, polowanie, ph
- trigger:
- if arg 1 is not set:
- send "{@tag} &3Commands:"
- send "&1/&3playerhunt zlecenie &1<&3player&1>"
- send "&1/&3playerhunt zlecenia"
- if arg 1 is "zlecenia":
- set {_z} to size of {playerhunt::list::*}
- open chest with 6 rows named "&3Zlecenia (&c%{_z}%&3)" to player
- wait 3 ticks
- loop 54 times:
- format slot loop-number - 1 of player with 1 of light gray glass pane named " " to be unstealable
- set {_slot} to 0
- loop {playerhunt::list::*}:
- set {_victim} to loop-index parsed as player
- format slot {_slot} of player with 1 of {_victim}'s skull named "&4%{_victim}%" with lore "&6Zleceniodawca: &a%{playerhunt::list::%{_victim}%::principal}%||&6Opis: &a%{playerhunt::list::%{_victim}%::lore}%||&bKliknij aby zobaczyc nagrode." to close then run [execute player command "ph prize %{_victim}%"]
- add 1 to {_slot}
- if arg 1 is "prize":
- wait 3 ticks
- open chest with 6 rows named "&4%arg 2%&3: Nagroda" to player
- wait 3 ticks
- add {playerhunt::list::%arg 2%::prize::*} to current inventory of player
- if arg 1 is "zlecenie":
- if arg 2 is set:
- if size of {playerhunt::list::*} is smaller than 54:
- if arg 2 parsed as player is online:
- if arg 2 parsed as player is not player:
- if {playerhunt::list::%arg 2%} is not set:
- set {playerhunt::cache::%player%} to arg 2
- send "{@tag} &3Podaj na czacie opis do zlecenia. Maksymalna ilosc znakow to {@min_lore_length}."
- send "{@tag} &3Jezeli nie chcesz ustawiac opisu zlecenie napisz na czacie ""NULL""."
- send "{@tag} &3Jezeli chcesz anulawac zlecenie napisz na czacie ""CANCEL""."
- stop
- else:
- send "{@tag} &cTen gracz jest juz na liscie."
- stop
- else:
- send "{@tag} &cNie mozesz wystawic zlecenia na siebie."
- stop
- else:
- send "{@tag} &cTen gracz jest niedostepny!"
- stop
- else:
- send "{@tag} &cLista zlecen jest pelna! Poczekaj az zwolni sie miejsce."
- stop
- else:
- send "{@tag} &cPoprawne uzycie: &1/&3playerhunt zlecenie &1<&3player&1>"
- stop
- on chat:
- if {playerhunt::cache::%player%} is set:
- if {playerhunt::list::%{playerhunt::cache::%player%}%::lore} is not set:
- cancel event
- if message is "CANCEL":
- clear {playerhunt::cache::%player%}
- send "{@tag} &3Zlecenie zostalo anulowane."
- stop
- else if message is "NULL":
- set {playerhunt::list::%{playerhunt::cache::%player%}%::lore} to "Brak opisu."
- else:
- if length of message is more than {@min_lore_length}:
- send "{@tag} &cMaksymalna dlugosc opisu wynosi {@min_lore_length}!"
- stop
- set {playerhunt::list::%{playerhunt::cache::%player%}%::lore} to "%message%"
- set {playerhunt::list::%{playerhunt::cache::%player%}%} to {playerhunt::cache::%player%}
- set {playerhunt::list::%{playerhunt::cache::%player%}%::principal} to player
- open chest with 6 rows named "&3Ustaw nagrode" to player
- send "{@tag} &3Opis zostal ustawiony. Teraz ustaw nagrode."
- send "{@tag} &3W przypadku nieustalenia nagrody, zlecenie zostanie anulowane."
- stop
- on inventory close:
- if inventory name of current inventory of player is "&3Ustaw nagrode":
- if {playerhunt::cache::%player%} is set:
- loop items in current inventory of player:
- add loop-item to {playerhunt::list::%{playerhunt::cache::%player%}%::prize::*}
- if size of {playerhunt::list::%{playerhunt::cache::%player%}%::prize::*} is not 0:
- broadcast "{@tag} &6%player% &3pragnie smierci gracza &6%{playerhunt::cache::%player%}%&3."
- else:
- send "{@tag} &cNie ustawiono nagrody. Zlecenie zostalo anulowane."
- clear {playerhunt::list::%{playerhunt::cache::%player%}%::*}
- clear {playerhunt::list::%{playerhunt::cache::%player%}%}
- clear {playerhunt::cache::%player%}
- stop
- on death:
- if victim is a player:
- if attacker is a player:
- if victim is not attacker:
- if {playerhunt::list::%victim%} is set:
- open chest with 6 rows named "&3Nagroda" to attacker
- loop {playerhunt::list::%victim%::prize::*}:
- add loop-value to current inventory of attacker
- broadcast "{@tag} &6%attacker% &3zabil gracza &6%victim%&3, wykonujac tym samym zlecenie gracza &6%{playerhunt::list::%victim%::principal}%&3."
- clear {playerhunt::list::%victim%::*}
- clear {playerhunt::list::%victim%}
- stop
- on inventory click:
- if inventory name of current inventory of player contains "&3: Nagroda":
- cancel event
Add Comment
Please, Sign In to add comment