Jump to content

Home

Death by scripting?


Malxados

Recommended Posts

I was wondering if/how you can kill someone using script attached to dialog (or any easier way) (example: Bob has been injured in a recent fight. When you talk to him, he will ask you to tell his wife he loved her. As soon as he's finished asking, he dies)

 

Malxados

Link to comment
Share on other sites

Yes, you can. Use the DestroyObject() function. It would look something like this.

 

void main() {
object oKill = GetObjectByTag( "persontokill" );
AssignCommand( oKill, ClearAllActions() );
SetCommandable( FALSE, oKill );
DestroyObject( oKill, 1.00 );
}

 

"persontokill" should be replaced with the tag of the creature in question. The 1.00 in DestroyObject() is a delay before deletion, so that the creature doesn't immediately disappear. You should use this script only at the very end of the dialog, else bad things might happen.

 

- Star Admiral

Link to comment
Share on other sites

Thanks Star Admiral for the fast reply. Would his body still be in the ground as normal, or would it disappear. (Example: would I have to make a script to have Bob give me a note for his wife, or would I be able to put the note in his inventory and take it from his dead body?)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...