function exchangeToBlocks(p: player, 1: item, 2: item):
set {_n} to amount of {_1} in {_p}'s inventory
if {_n} >= 9:
set {_n} to rounded down {_n} / 9
remove ({_n} * 9) of {_1} from {_p}'s inventory
add {_n} of {_2} to {_p}
function exchangeToKox(p: player):
set {_n} to amount of apples in {_p}'s inventory
set {_n1} to amount of gold blocks in {_p}'s inventory
while {_n} >= 1:
if {_n1} < 8:
stop
remove 1 from {_n}
remove 8 from {_n1}
remove 1 apple from {_p}'s inventory
remove 8 gold blocks from {_p}'s inventory
if {_p} has enough space for 1 enchanted golden apple:
give {_p} 1 enchanted golden apple
else:
drop 1 enchanted golden apple at {_p}
command /bloczki [<text>]:
trigger:
wait 5 tick
open chest with 2 rows named "Bloki" to player
set player's current inventory's slot 15 to enchanted golden apple named "&fTWORZENIE KOXA"
set player's current inventory's slot 16 to golden apple named "&fTWORZENIE REFILA"
set player's current inventory's slot 1 to diamond block named "&fTWORZENIE BLOKOW DIAMENTOW"
set player's current inventory's slot 2 to emerald block named "&fTWORZENIE BLOKOW EMERALD"
on inventory click:
inventory name of current inventory of player is "Bloki"
cancel event
if clicked slot is 1:
exchangeToBlocks(player, diamond, diamond block)
else if clicked slot is 2:
exchangeToBlocks(player, emerald, emerald block)
else if clicked slot is 15:
exchangeToKox(player)
if player doesn't have 1 apple and 8 gold block:
send "Nie masz wszystkich przedmiotow."
stop
wait 1 tick
wszystko dziala ale chce jeszcze mozliwosc zrobienia refila na slocie 16. Ponadto nie chce by zamykalo sie gui gdy nacisne prawym na wolny slot/pole w gui.
Pytanie
SkrytyZiomus 3
wszystko dziala ale chce jeszcze mozliwosc zrobienia refila na slocie 16. Ponadto nie chce by zamykalo sie gui gdy nacisne prawym na wolny slot/pole w gui.
Edytowane przez xAxeePoprawiam formatowanie
Notatka dodana przez xAxee
Odnośnik do komentarza
Udostępnij na innych stronach
2 odpowiedzi na to pytanie
Rekomendowane odpowiedzi
Dołącz do dyskusji
Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.