Okay, here's the spawn script, this one I use to create unselectable corpses:
//Spawn in Dead
void main()
{
SetIsDestroyable(FALSE, FALSE, FALSE);
SetLootable(OBJECT_SELF, FALSE);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDeath(), OBJECT_SELF);
}
And here's the heartbeat script, the one that's not working:
//ZombieHeartbeat
#include "nw_i0_generic"
void main()
{
object oCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
if (GetIsObjectValid(oCreature) == TRUE && GetDistanceToObject(oCreature) < 10.0)
{
object oTarget;
oTarget = OBJECT_SELF;
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectResurrection(), OBJECT_SELF);
ActionAttack(oCreature);
DetermineCombatRound(oCreature);
}
}
Modifié par Snarkblat, 28 juillet 2011 - 03:59 .