This function has two distinct forms that work slightly differently. Form (2) saves a KVP attribute on a mob or item, and form (1) saves a KVP attribute on a player. Neither form will work on the opposite type of character.
The player form, (1), saves a KVP attribute in the CFG_PLAYER stanza of KVP entries for the given player. If used on a non-player, it does nothing and returns null. Attributes saved with form (1) are loaded automatically when the player enters the game, they do not need to be explicitly loaded with load_attr.
The mob/item form, (2), saves a KVP attribute so it will persist through crashes or reboots of the Mud. The attribute is always associated with the mob or item running the current MUDL script - a MUDL-enabled mob or item cannot save data on other mobs or items. The attribute can be retrieved from disk with the load_attr function. Note that there is only one set of attributes per mob vnum or item vnum - you cannot use this function to store permanent data for one specific mob or item with a certain vnum if many such exist.
These functions do not set the actual value of the KVP attribute, they just cause an existing attribute to be saved to disk. If the given attribute name starts with !, instead of saving the attribute it is deleted and then its absence is saved.
Use this function sparingly - frequent use might slow down the Mud noticeably for everybody!