Jump to content

Killactor script error?


philios82

Recommended Posts

Hi folks,

 

I'm trying to make a script so that when an object is given to the player a specific NPC dies. No matter what I do it wont save in the Geck, from what I understand this means that there is an error in the script? It's a very simple script and I can't see whats wrong with it, I've run it through Cipscis's Script validator and that finds no errors. Hopefully someone can spot my mistake.

 

scn killSarah

 

int Myvar

 

Begin OnAdd player

 

if Myvar == 0

PGONPC02Sarah.killactor

set Myvar to 1

endif

End

 

Cheers.

Link to comment
Share on other sites

killactor can only be used on object references and reference variables.

 

You need to use the actor's reference ID from the cell it's in. For example, in the Goodsprings Saloon, GSSunnySmiles is the actors editor ID, but her reference ID is SunnyRef.

 

So using my example, the following would be a valid script:

 

scn SomeScript

int Myvar

 

Begin OnAdd player

 

if Myvar == 0

SunnyRef.killactor

set Myvar to 1

endif

End

Edited by Sunnie
Link to comment
Share on other sites

killactor can only be used on object references and reference variables.

 

You need to use the actor's reference ID from the cell it's in. For example, in the Goodsprings Saloon, GSSunnySmiles is the actors editor ID, but her reference ID is SunnyRef.

 

 

 

Just tried it and that works, cheers.

Edited by philios82
Link to comment
Share on other sites

Okay now I've spent the last few hours trying to get this script to dismember the NPC, the script runs and the NPC is killed but they never lose a limb. I've tried on all sorts of NPCs. The scrpit is below, any ideas would be welcome.

 

 

scn killSarah

 

int Myvar

 

Begin OnAdd player

 

if Myvar == 0

Sarahref.killactor sunnyref 1 2

set Myvar to 1

endif

End

Link to comment
Share on other sites

  • Recently Browsing   0 members

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