PoA_PRC8/_module/nss/auto_door_key.nss
Jaysyn904 8d97886c3f Changed folder name.
Changed folder name.
2022-10-07 21:08:37 -04:00

28 lines
542 B
Plaintext

//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);
}
}