Files
HeroesStone_PRC8/_module/nss/door_close.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

33 lines
850 B
Plaintext

// Auto close door and lock door
// based on ints stored on the object.
// Defaults to 15 seconds.
// Note: for transitions, both doors need to have
// this script and nClose needs to be the same.
void main()
{
int dBug = FALSE;
object oDoor = OBJECT_SELF;
int nClose = GetLocalInt(oDoor, "nClose");
int nLockup = GetLocalInt(oDoor, "nLockup");
if(nClose == 0)
nClose = 3; // Default delay
// if(nClose)
// {
float fClose = IntToFloat(nClose);
float fLock = fClose + 0.5 ;
DelayCommand(fClose,ActionCloseDoor(oDoor));
if(nLockup > 0)
DelayCommand(fLock,SetLocked(oDoor, TRUE));
// }
if(dBug)
WriteTimestampedLogEntry(GetTag(oDoor) + " - nClose is " + IntToString(nClose) + "\n" +
"nLockup is " + IntToString(nLockup));
}