execute @s[tag=!on] ~ ~ ~ execute @p[r=3,scores={primarymagic=4}] ~ ~ ~ scoreboard players add @s primaryexp 60
execute @s[tag=!on] ~ ~ ~ execute @p[r=3,scores={secondarymagic=4}] ~ ~ ~ scoreboard players add @s secondaryexp 60

execute @p[r=3,scores={primarymagic=4}] ~ ~ ~ tag @e[type=vatonage:lightball,r=3] add on
execute @p[r=3,scores={secondarymagic=4}] ~ ~ ~ tag @e[type=vatonage:lightball,r=3] add on
execute @s[tag=!on] ~ ~ ~ tellraw @p {"rawtext":[{"text":"§cYou haven't unlocked this magic"}]}
execute @s[tag=!on] ~ ~ ~ replaceitem entity @p slot.weapon.mainhand 0 vatonage:empty_wand
kill @s[tag=!on]

execute @s[scores={removedebris=1}] ~ ~ ~ playsound block.end_portal_frame.fill @a ~ ~ ~
particle minecraft:shulker_bullet ~ ~ ~

scoreboard objectives add removedebris dummy removedebris
scoreboard players add @s removedebris 1
execute @s[scores={removedebris=500..}] ~ ~ ~ kill @s

execute @s[scores={removedebris=1}] ~ ~ ~ effect @p[r=5] regeneration 2 0 true