I've created a special swinging door which opens and won't budge until you press the use button on either side of the door to close it. This can be easily achieved by the following script:
Code: Select all
int allapot;
script 5 (int polyid, int speed)
{
if(allapot == 0)
{
polywait(polyid);
delay(3);
Polyobj_OR_RotateRight(polyid, -speed, 60);
allapot = 1;
}
else
{
polywait(polyid);
delay(3);
Polyobj_OR_RotateRight(polyid, speed, 60);
allapot = 0;
}
}
I'd like to have several swinging doors working correctly (as I mentioned in the first sentence) around the map but I don't know how to write a script which can be used as an universal one and doesn't mess up the opening directions of the doors and cause the door to move into the wall repeatedly. Do you have any suggestions for this?