So I have a script that has a gethealth function at the bottom of it. The script is placed on a creature.
Basically when the creature dies I want the creature to disable and play effects. The first part of the script deals with the creatures AI while the mid part deals with its timer (its part 2 of a summon script)
the final part is suposed to deal with the fact that if the crreature dies, it then "disappears" - i.e becomes unsummoned.
but the end bit doesnt seem to work...
begin sm_FH_AIScript
float timer
short count
short doOnce
if ( doOnce == 0 )
aifollow, player, 0, 0, 0, 0
PlaceAtMe sprigganup 1 1 1 ; Visual effect
set doOnce to 1
endif
if ( GetDisabled == 1 );the creature has been disabled
set count to ( count + 1 )
if ( count == 5 )
DontSaveObject;make sure it isn't saved (duh!)
SetDelete, 1;delete it from current game
endif
endif
if ( MenuMode == 1 );make sure it doesn't count during inventory and dialogue
Return
endif
set timer to ( timer + GetSecondsPassed )
if ( timer < 30 );don't do anything until 30 seconds have passed
return
endif
PlaceAtMe sprigganup 1 1 1 ; Visual effect
Disable
if ( Gethealth == 0 )
PlaceAtMe sprigganup 1 1 1
Disable
endif
end
float timer
short count
short doOnce
if ( doOnce == 0 )
aifollow, player, 0, 0, 0, 0
PlaceAtMe sprigganup 1 1 1 ; Visual effect
set doOnce to 1
endif
if ( GetDisabled == 1 );the creature has been disabled
set count to ( count + 1 )
if ( count == 5 )
DontSaveObject;make sure it isn't saved (duh!)
SetDelete, 1;delete it from current game
endif
endif
if ( MenuMode == 1 );make sure it doesn't count during inventory and dialogue
Return
endif
set timer to ( timer + GetSecondsPassed )
if ( timer < 30 );don't do anything until 30 seconds have passed
return
endif
PlaceAtMe sprigganup 1 1 1 ; Visual effect
Disable
if ( Gethealth == 0 )
PlaceAtMe sprigganup 1 1 1
Disable
endif
end