on rightclick with compass: if amount of all players > 54: stop open chest inventory with 6 rows named "&cKompas" to player set {_} to 0 loop all players: set slot {_} of player's current inventory to skull of ("%loop-player%" parsed as offlineplayer) named "%loop-player%" add 1 to {_} function compass(p: player, t: offlineplayer): set {compassTarget::%{_p}%} to {_t} while {compassTarget::%{_p}%} is online: {_p} is online {_p} is in world "world" {compassTarget::%{_p}%} is in world "world" if {_p} has compass: set compass target of {_p} to {compassTarget::%{_p}%} send action bar "&7Namierzanie: &e%{compassTarget::%{_p}%}%" to {_p} wait 5 ticks on join: compass(player,player) on quit: delete {compassTarget::%player%} on inventory click: name of player's current inventory = "&cKompas" clicked inventory is not player's inventory cancel event clicked slot is not air delete {compassTarget::%player%} set {_} to ("%name of clicked slot%" parsed as offlineplayer) close player's inventory wait 15 ticks compass(player,{_}) on respawn: set slot 9 of player's inventory to compass