Jump to content

Resurrect NPC


eleglas

Recommended Posts

I'm trying to make a firing range with an NPC that you can kill and you can push a button that will resurrect him; this is my script so far:

SCN PrisonerResurrect

 

Ref MyLink5

 

Begin OnActivate

 

Set MyLink5 to GetLinkedRef

 

if MyLink5 Dead == 1

 

MyLink5.Resurrect

 

Endif

 

END

 

It doesn't seem to work, can someone help me get it working?

Link to comment
Share on other sites

kk, try this:

 

Create a new custom trigger (I used the Vault112 garage for testing, the trigger for the basement door that sits on the wall, then made a new form id base for it). Place your prisoner in the cell and give him a unique editor reference id (I used PrisonerREF). Now copy/paste these two scripts into the GECK:

 

scn PrisonerResurrectSCRIPT

BEGIN GameMode
PrisonerREF.GetDead ;checks every frame whether the ref is dead and returns a 1 if it is
END

 

Use this script in your NPC.

 

scn PrisonerResurrectTRIGGER

BEGIN OnActivate
if PrisonerREF.GetDead == 1 ;if GetDead has returned a 1, ie the prisoner has been killed
	PrisonerREF.Resurrect ;resurrect him
endif
END

 

Use this in your new trigger form.

 

Now, when you kill him, GetDead will be set to 1, then when you press the trigger on the wall (or wherever) it'll check GetDead, see that it's returning '1', and resurrect the prisoner where he was killed. You could also add a PrisonerREF.MoveTo after the resurrect and add a marker in the GECK to have him moved to after resurrection, so he always reappears in the same location :)

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

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