PoA_PRC8/_module/nss/auto_door_key.nss

28 lines
542 B
Plaintext
Raw Normal View History

2022-10-07 14:20:31 -04:00
//IMPORTANT, use the Save As button FIRST, before you Edit This Script!
//Put this script OnClick or OnFailToOpen
void main()
{
object oPC = GetClickingObject();
if (!GetIsPC(oPC)) return;
if (GetItemPossessedBy(oPC, "keytag")!= OBJECT_INVALID)
{
SetLocked(OBJECT_SELF, FALSE);
ActionOpenDoor(OBJECT_SELF);
DelayCommand(5.0, ActionCloseDoor(OBJECT_SELF));
DelayCommand(5.0, SetLocked(OBJECT_SELF, TRUE));
}
else
{
FloatingTextStringOnCreature("A specific key is needed to open this door.", oPC, TRUE);
}
}