on right click on villager:
if name of clicked entity is "nazwanpc":
open chest with 1 rows named "nazwagui" to player
wait 2 tick
loop 1 times:
set player's current inventory's slot loop-number -1 to gray stained glass pane named " "
set player's current inventory's slot 0 to 1 diamond block named "nazwaprzedmiotu"
set player's current inventory's slot 1 to 1 diamond block named "nazwaprzedmiotu"
set player's current inventory's slot 2 to 1 diamond block named "nazwaprzedmiotu"
set player's current inventory's slot 3 to 1 diamond block named "nazwaprzedmiotu"
on inventory click:
if "%inventory name of player's current inventory%" is "nazwagui":
cancel event
if "%slot%" is "0":
execute console command "oglos bc elo"
if "%slot%" is "1":
execute console command "oglos bc elo"
if "%slot%" is "2":
execute console command "oglos bc elo"
if "%slot%" is "3":
execute console command "oglos bc elo"