There you go, in case you need more help, ask.
Quote:
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
if (GetItemPossessedBy(oPC, "RRToken")== OBJECT_INVALID)
{
//Every single variable you use must be declared.
string sDeny; sDeny="This portal needs the RR Token to activate. You apparently do not possess an RR Token.";
SendMessageToPC(oPC, sDeny);
return;
}
object oTarget;
location lTarget;
oTarget = GetWaypointByTag("RRenter");
lTarget = GetLocation(oTarget);
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(lTarget));
}
If you want something more organized.
Quote:
//DiaboSatan likes to help
void main()
{
object oPC = GetLastUsedBy();
//Checks if the player has the item, if positive jump him to "RRenter"
if (GetItemPossessedBy(oPC, "RRToken")!=OBJECT_INVALID)
{
object oTarget = GetWaypointByTag("RRenter");
location lTarget = GetLocation(oTarget);
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(lTarget));
}
//If negative, he'll get that message.
else
{
string sDeny="This portal needs the RR Token to activate. You apparently do not possess an RR Token.";
SendMessageToPC(oPC, sDeny);
}
}