Trying to make a script that causes a placeable to explode when player tries to break it and do them damage like a trap would.
Tried just making it trapped but that did not work like I wanted it to
Tried using the Lilac soul script but it won't compile for me
void main()
{
object oSelf = OBJECT_SELF;
effect eVFX;
effect eDamage;
// Get the creature who triggered this event.
object oPC = GetLastHostileActor();
// Only fire once per PC.
if ( GetLocalInt(OBJECT_SELF, "DO_ONCE__" + ObjectToString(oPC)) )
return;
SetLocalInt(OBJECT_SELF, "DO_ONCE__" + ObjectToString(oPC), TRUE);
// Cause damage.
eDamage = EffectDamage(d10(3), DAMAGE_TYPE_ELECTRICAL);
eVFX = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC)
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX , oPC)
// Destroy an object (not fully effective until this script ends).
DestroyObject(oSelf);
}
it first gives me errors at ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX , oPC)
and if I remove that it errors at DestroyObject(oSelf);
so not sure what I need to do I have 12 of these items around a room that the players may need to deal with





Наверх







