variables: {misja::1} = 10 #ile mobow trzeba zabic {misja::2} = 50 #ile mobow trzeba zabic function misja(p:player,n:number): {misja::%{_n}%::%{_p}%} is false if {misja::%{_n}%::%{_p}%::postep} is not set: set {misja::%{_n}%::%{_p}%::postep} to 0 add 1 to {misja::%{_n}%::%{_p}%::postep} if {misja::%{_n}%::%{_p}%::postep} >= {misja::%{_n}%}: send "ukonczyles misje" to {_p} set {misja::%{_n}%::%{_p}%} to true if {_n} < 9: add 1 to {_n} set {misja::%{_n}%::%{_p}%} to false on rightclick on entity: event-entity is villager name of event-entity = "&cnazwa" # nazwa villagera open chest inventory named "&cnazwa" with 1 row to player #nazwa gui z misjami loop 2 times: # ilosc misji if {misja::%loop-number%::%player%} is true: set slot (loop-number - 1) of player's current inventory to yellow stained glass pane else if {misja::%loop-number%::%player%} is false: set slot (loop-number - 1) of player's current inventory to green stained glass pane else: set slot (loop-number - 1) of player's current inventory to gray stained glass pane on join: if {misja::1::%player%} is not set: set {misja::1::%player%} to false on death: attacker is a player victim is not a player if {misja::1::%player%::postep} > {misja::1}: misja(attacker,2) else: misja(attacker,1) on inventory click: name of player's inventory = "&cnazwa" clicked inventory is not player's inventory cancel event