I have a statue ..with this script in the ondeath.
question: If a PC smashes the statue it respawns ....BUT if it is destroyed by my other script when someone clicks on a door it does not respawn .
I need this statue to respawn after being destroyed .....
void RespawnObject(string sResRef, int iType, location lLoc) {
CreateObject(iType, sResRef, lLoc);
}
void main()
{
string sResRef = GetResRef(OBJECT_SELF);
int iType = GetObjectType(OBJECT_SELF);
// For creatures, save the location at spawn-time as a local location and
// use it instead. Otherwise, the creature will respawn where it died.
// No changes are required for placeables as they do not move (usually ;-)
location lLoc =GetLocation(OBJECT_SELF);
float fDelay = 10.0; // 5 minute delay; adjust as desired
AssignCommand(GetModule(), DelayCommand(fDelay, RespawnObject(sResRef, iType, lLoc)));
}
Respawn object help?
Débuté par
Knight_Shield
, déc. 29 2010 10:56
#1
Posté 29 décembre 2010 - 10:56
#2
Posté 29 décembre 2010 - 11:37
I don't think the DestroyObject() function triggers a placeable's OnDeath event. You'll have to use something like this to destroy the statue:Knight_Shield wrote...
I have a statue ..with this script in the ondeath.
question: If a PC smashes the statue it respawns ....BUT if it is destroyed by my other script when someone clicks on a door it does not respawn .
I need this statue to respawn after being destroyed .....
object oStatue = GetObjectByTag("StatueTag");
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetCurrentHitPoints(oStatue)), oStatue);
-420
#3
Posté 30 décembre 2010 - 12:02
It works really good ...thnx 420 ! ! ! This is for my exploding Monster Statues muwahaha





Retour en haut







