Skript Egg Hunt Issue

So this is my skript:
on right click on turtle egg:
if {foundeggs.%player%} contains "%location of event-block%":
send "&cYou've already found this egg!" to player
else:
if {eggcount.%player%} is not set:
set {eggcount.%player%} to 1
else if {eggcount.%player%} is 29:
add 1 to {eggcount.%player%}
send "&eYou've found all of the eggs! Here's a reward: /pv 1, 2 & /ec" to player
add "%location of event-block%" to {foundeggs.%player%}
console command "lp user %player% permission set essentials.enderchest true"
console command "lp user %player% permission set playervaults.amount.2 true"
else:
add 1 to {eggcount.%player%}
send "&aYou've found an egg! You now found %{eggcount.%player%}% out of 30 eggs!" to player
add "%location of event-block%" to {foundeggs.%player%}

command /reseteggcount [<player>]:
permission: op
trigger:
clear {eggcount.%player%}
clear {foundeggs.%player%}

And I tried making it so you can't spam the eggs every possible way but for some reason it doesn't work and there are no error messages, can someone help?