scoreboard players reset * hastodrawdelay


#select a card
tag @e[tag=temp] remove temp
tag @r[type=cero:card,tag=deck] add temp
tag @e[tag=temp] remove deck
tag @e[tag=temp] add player2


#teleport card to slot
function checkslot/player2
tp @e[tag=temp] @e[tag=checkslot]
execute @e[tag=temp] ~ ~ ~ tp @s ~ ~ ~ ~-45 0
tp @e[tag=checkslot] ~ ~-1000 ~
kill @e[tag=checkslot]


#event
event entity @e[tag=temp] player2


#give texture
scoreboard players set @e[tag=temp] scheduletexture 1


#playsound
execute @a ~ ~ ~ playsound step.grass @s


#remove temp tag
tag @e[tag=temp] remove temp


#remove drawscore
scoreboard players remove @a[tag=turn] hastodraw 1


#cardcount
function count_cards


#check if hastodraw remaining remaining
execute @a[tag=turn,scores={hastodraw=1..}] ~ ~ ~ scoreboard players set @a[tag=turn] hastodrawdelay 0
execute @a[tag=turn,scores={hastodraw=0}] ~ ~ ~ scoreboard players set @a[tag=turn] hastodrawdelay 20