hastag

hastag <player> <string>

Whether a player carries a given marker tag.

Tags are named markers attached to a player by tag and removed by untag. hastag reports whether a particular marker is present. Tags live on players only; the first argument must be a player, so guard with isplayer when the creature might be an NPC.

Arguments

Returns

A booltrue if the player has the named tag, false otherwise.

Examples

after command (say) {
  require [isplayer $actor]
  if [not [hastag $actor "greeted"]] {
    do "say Welcome! I'll remember you."
    tag $actor "greeted"
  }
}

The require guard ensures the actor is a player before hastag runs; the greeting then fires once, after which the greeted tag suppresses it on later visits.

See also