void dyingeffect(int AmmountToBleed) { object oPlayerDying = GetLastPlayerDying(); int CurrentHPs = GetCurrentHitPoints(oPlayerDying); int toggle = 0; object Death = GetItemPossessedBy(oPlayerDying, "death"); if(CurrentHPs > 0) { toggle = 1; SetLocalInt(oPlayerDying, "dying", 0); if(Death != OBJECT_INVALID) { DestroyObject(Death); } } if(CurrentHPs <= 0) { toggle = 1; effect KillPlayer = EffectDeath(); ApplyEffectToObject(DURATION_TYPE_INSTANT, KillPlayer, oPlayerDying); } /*if(CurrentHPs <= 0) { effect Blood = EffectVisualEffect(VFX_COM_BLOOD_REG_RED); ApplyEffectToObject(DURATION_TYPE_INSTANT, Blood, oPlayerDying); effect Dmg = EffectDamage( AmmountToBleed, DAMAGE_TYPE_DIVINE, DAMAGE_POWER_ENERGY); ApplyEffectToObject(DURATION_TYPE_INSTANT, Dmg, oPlayerDying); } */ if(toggle != 1) { DelayCommand(6.0, dyingeffect(1)); } } void main(){ object DyingPerson = GetLastPlayerDying(); object DeathItem = GetItemPossessedBy(DyingPerson, "death"); if(DeathItem == OBJECT_INVALID){ CreateItemOnObject("death", DyingPerson);} SetLocalInt(DyingPerson, "dying", 1); DelayCommand(6.0, dyingeffect(1)); }