#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#
#    This function has been created by Skilendarz Group.
#             https://skilendarz.com
#
#      GIVE MAP MAKERS THE CREDIT THEY DESERVE!
#             COPYING IS PROHIBITED!
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#Click
scoreboard players set @s buy -1
execute unless data entity @s EnderItems[{Slot:0b}] run scoreboard players set @s buy 0
execute unless data entity @s EnderItems[{Slot:1b}] run scoreboard players set @s buy 1
execute unless data entity @s EnderItems[{Slot:2b}] run scoreboard players set @s buy 2
execute unless data entity @s EnderItems[{Slot:9b}] run scoreboard players set @s buy 3
execute unless data entity @s EnderItems[{Slot:10b}] run scoreboard players set @s buy 4
execute unless data entity @s EnderItems[{Slot:11b}] run scoreboard players set @s buy 5
execute unless data entity @s EnderItems[{Slot:18b}] run scoreboard players set @s buy 6
execute unless data entity @s EnderItems[{Slot:19b}] run scoreboard players set @s buy 7
execute unless data entity @s EnderItems[{Slot:20b}] run scoreboard players set @s buy 8

#Select
execute if score @s buy matches 0.. run function f:lobby/win_effects/select

function f:lobby/win_effects/gui