So I am using Citizens and SkRayFall Plugin to help me make a custom guard plugin. But I don't know how to make it so once a player makes a guard it's ID is put into a category called guard and I can check if a player is near a guard when he/she attacks here is my code.
code_language.skript:
command /guard:
trigger:
create a citizen named "&9&lGuard" at location of player
set {_c} to last created citizen
message "&8You have created a Guard"
make citizen {_c} hold iron sword
set citizen last created citizen max health to 400
on damage of a player:
if distance between the player and citizen {_c} is smaller than 20:
make citizen {_c} attack player