Hiya sweeties,
I have this script that's supposed to give xp when a PC enters a new area and then set a variable on an object they carry so that they don't keep getting xp for entering that area again, but it isn't working right. The PC keeps getting xp no matter how many times they re-enter the area. What am I missing or doing wrong? Any help is greatly appreciated.
/*
* Script generated by LS Script Generator, v.TK.0
*
* For download info, please visit:
*
http://nwvault.ign.c....Detail&id=1502
*/
// Put this script OnEnter.
void main()
{
object oTarget;
// Get the creature who triggered this event.
object oPC = GetEnteringObject();
// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
return;
// Send a message to the player's chat window.
SendMessageToPC(oPC, "You have discovered a new area. Exploration xp granted.");
// Give 50 experience to the PC.
GiveXPToCreature(oPC, 50);
// Set a local integer.
oTarget = GetObjectByTag("TokenExplore");
SetLocalInt(oTarget, "ExplorationXP", 1);
}