Simple script

Post » Sat May 28, 2011 10:28 am

Hi!

I have one simple request, I need a script that will disable NPC's body after one game day since his death. I've tried to do this on my own, but I've failed (I've never tried real scripting, just very simple ones)

Thanks in advance!
User avatar
Gaelle Courant
 
Posts: 3465
Joined: Fri Apr 06, 2007 11:06 pm

Post » Fri May 27, 2011 9:16 pm

Untested, but it may work :wavey:
begin mnmDisableAfterDeathScriptshort deathDayshort deathHourif ( GetDisabled )	returnendifif ( GetHealth <= 0 )	if ( deathDay == 0 )		set deathDay to Day		set deathHour to GameHour	endif	if ( Day > deathDay )		if ( GameHour > deathHour )			disable		endif	endif	returnendifif ( GetHealthGetRatio <= 0.04 )	set deathDay to Day	set deathHour to GameHour	ModCurrentHealth -10000  ; really kill me, ensuring GetHealth returns <= 0endifend 
[EDIT]added code section to GetHealth
User avatar
ONLY ME!!!!
 
Posts: 3479
Joined: Tue Aug 28, 2007 12:16 pm

Post » Sat May 28, 2011 12:35 am

Yeah, it works now. Thank you so much!
User avatar
Steve Fallon
 
Posts: 3503
Joined: Thu Aug 23, 2007 12:29 am


Return to III - Morrowind