How to associate with player

tick func ```#hat detects #propeller hat execute as @a[scores={carrot_used=1..}] if items entity @s weapon.mainhand carrot_on_a_stick[custom_model_data={strings:["prophat"]}] run schedule function hw:prophat 1t

scoreboard players reset @a carrot_used```

prophat func ```execute as @a if items entity @s weapon.mainhand carrot_on_a_stick[custom_model_data={strings:["prophat"]}] unless entity @s[nbt={equipment:{head:{}}}] run item replace entity @s armor.head with carrot_on_a_stick[custom_model_data={strings:["prophat"]},item_name=[{"color":"dark_red","text":"Prop"},{"color":"yellow","text":"eller"},{"color":"dark_blue","text":" Hat"}],enchantment_glint_override=false,enchantments={binding_curse:1},tooltip_display={hidden_components:[enchantments]}] execute as @a if entity @s[nbt={equipment:{head:{id:"minecraft:carrot_on_a_stick",components:{"minecraft:custom_model_data":{strings:["prophat"]}}}}}] if items entity @s weapon.mainhand carrot_on_a_stick[custom_model_data={strings:["prophat"]}] run item replace entity @s weapon.mainhand with air execute as @a at @s run playsound minecraft:item.armor.equip_leather master @s ~ ~ ~ 1 1.5

schedule function hw:equiphr 600t```

equiphr func ```execute as @a if items entity @s armor.head carrot_on_a_stick run item replace entity @s armor.head with air


I'm trying to get it so when someone equips a hat, they have it on fro 30 seconds then it get removed, but at the moment, it removes hats from everyone, not sure how to set timer for individual people when they equip a hat, would like one function that just clears the head slot for the person that equipped there hat like individual timers but they all lead to the same function but the function only applies to the player that equipped a hat 30 seconds prior, you get what I mean? how would one do that?
Continue to help post