How do I get an npc to destroy himself after a conversation? here is the script i tried to make. But its not working.
int nInt;
object oTarget;
/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.3
For download info, please visit:
http://nwvault.ign.c...&id=4683&id=625 */
//Put this on action taken in the conversation editor
#include "nw_i0_tool"
void main()
{
object oPC = GetPCSpeaker();
if (GetIsSkillSuccessful(oPC, SKILL_TAUNT, 4))
{
ActionSpeakString("Okay, Okay, don't hurt me. Take it");
ActionGiveItem(GetItemPossessedBy(OBJECT_SELF, "Jirovens_Coin"), oPC);
RewardPartyXP(45, oPC, FALSE);
oTarget = OBJECT_SELF;
//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_BLOOD_CRT_RED), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_BLOOD_CRT_RED), GetLocation(oTarget));
DestroyObject(oTarget, 3.0);
}
else
{
ActionSpeakString("HA, HA, ohh, I'm so scared.");
}
}
Modifié par Baishi7, 21 juillet 2010 - 11:02 .