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

42 lines
927 B
Plaintext

//Script Name: day_night_check
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On: 8/19/08
/////////////////////////////////////////
/*
This script checks the time of day,
and if it's day, the door unlocks,
otherwise it tells the PC's why
they cannot enter.
*/
////////////////////////////////////////
//Put this script in the OnFailToOpen Event of the Day / Night Door
void main()
{
object oPC = GetClickingObject();
if (!GetIsPC(oPC)) return;
if (GetIsDay())
{
SetLocked(OBJECT_SELF, FALSE);
ActionOpenDoor(OBJECT_SELF);
DelayCommand(15.1, ActionCloseDoor(OBJECT_SELF));
}
else if (GetIsNight())
{
ActionSpeakString("This door is barred from the inside and is unoppenable.");
}
else
{
//Debug Message to DMs (This should NEVER Happen)
SendMessageToAllDMs("Error on Day / Night Door Script, you need to check the (day_night_check) script");
}
}