Something like this should work. Just slap this in the scared NPCs OnPerception event.
void main()
{
//Get the last creature percieved. We'll call it oNPC.
object oNPC = GetLastPerceived();
//If oNPC is a player(or DM) or was not percieved by seeing, then end.
if (GetIsPC(oNPC) || !GetLastPerceptionSeen()) return;
//if oNPC is hostile then do stuff.
if (GetIsEnemy(oNPC, OBJECT_SELF))
{
ClearAllActions(TRUE);
PlayVoiceChat(VOICE_CHAT_PAIN2, OBJECT_SELF);
ActionSpeakString("Don't kill me!");
ActionMoveAwayFromObject(oNPC, TRUE, 40.0);
}
}
Hope it helps.
Modifié par GhostOfGod, 01 octobre 2010 - 07:49 .