Ok here's a quick tutorial. Place your NPC, open him up and give him a reference ID (JasonREF). Go to his packages. Create a new package and make it a sandbox package. In the wander location, if your NPC is in an interior, tick In Cell and find the cell. If the NPC is outside, make the wander location 'Near Current Location'. Now that's sorted, we move onto the script. Click on the pencil button on your toolbar. A small window should appear. Click File/New. Use this script (Edit where I say) scn YourScriptName
Begin GameMode
if (Player GetInSameCell YourNPCREF == 1)
if (Player IsInCombat == 1)
YourNPCREF.SetActorsAI 0
elseif (Player GetInSameCell YourNPCREF == 0)
elseif (Player IsInCombat == 0)
YourNPCREF.SetActorsAI 1
endif
endif
endif
end I've tested this and it has worked for me. Tell me if there's any problems