Jump to content

Script Help Request: NPC Explode After Death


runningaround

Recommended Posts

So I've been trying to get a custom NPC follower to explode when they die, but the scripts I've tried haven't worked.

 

I was wondering if anyone could help. The scripts I tried are below...I have no scripting experience.

 

Scriptname LucyDeathsplosion extends activemagiceffect  

Actor selfRef
explosion property FXLucyDeathsplosion  auto
int ActorHealth 

EVENT onDying(actor myKiller)
	ActorHealth = selfRef.GetAV("Health") as int
	if ActorHealth <= 0
		wait(1.5)
		selfRef.placeAtMe(FXLucyDeathsplosion)
	endif
ENDEVENT

 

and

 

Scriptname LucyDeathsplosion extends activemagiceffect  

Explosion property FXLucyDeathsplosion  Auto

Event onDying(actor killer)
	getTargetActor().placeAtMe(LucyDeathsplosion )
EndEvent

Link to comment
Share on other sites

  • 1 month later...

Try this:

 

Scriptname LucyDeathsplosion extends Actor

Explosion property FXLucyDeathsplosion  Auto

Event onDying(actor killer)
        Self.placeAtMe(LucyDeathsplosion )
EndEvent

 

It's more or less identical to something I did and it worked fine.

If it does not, change 'onDying' to 'onDeath' because that is what I had and it worked great.

 

Also make sure you set the property! Right click on the script in the Actor window, and click 'Properties'. If "FXLucyDeathsplosion" is the name of the explosion you can simply click auto-fill and it will do it for you.

Edited by AmeaAya
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...