PoA_PRC8/_module/nss/invroom_onenter.nss

35 lines
796 B
Plaintext
Raw Normal View History

2022-10-07 14:20:31 -04:00
//This script must go into the OnEnter event of the Inventory Room Area
//It prevents anyone from entering unless they are suppose to!
//NOTE: If the PC loggs out, then loggs back in they will be teleported out!
//Put this script OnEnter
void main()
{
object oPC = GetEnteringObject();
object oTarget;
object oSpawn;
location lTarget;
int nClear = GetLocalInt(oPC, "INVROOMUSER");
//Allow DMs in here....
if (!GetIsPC(oPC)) return;
//If the PC is the User, let them in (stop the script)
if (nClear == 1)
{ return; }
//Otherwise, teleport them out immediately!
object oTarget2 = GetWaypointByTag("home");
location lTarget2 = GetLocation(oTarget);
if (oTarget2==OBJECT_INVALID) { return; }
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToObject(oTarget2));
}