FANDOM


This is a basic OnPerceived script which will check for an item and make the NPC hostile if the PC does not have it equipped:

// Goes in the OnPercieved of an NPC
// Checks a PC has the correct item equipped in a specific inventory slot
void main()
{
object oPC = GetLastPerceived();
object oDisguise = GetObjectByTag("disguise");
// Insert the correct item tag
if (GetIsPC(oPC))
    {
    object oTarget = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
    // Change the inventory slot as required
    if (oTarget != oDisguise)
        {
        // Uncomment the appropriate lines or add your own custom code
        // AdjustFactionReputation(oPC,OBJECT_SELF,-100);//This would make the NPC's whole faction hostile
        // SetIsTemporaryEnemy(oPC);//This is for just this NPC
        // ActionAttack(oPC);// Ensures the NPC will attack immediately
        }
    }
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.