Jump to content

Keep NPC From Opening Door?


Fragginborn

Recommended Posts

I have an NPC that keeps opening a door that is supposed to remain locked for the player to open.

 

The door is locked with a key, yet the NPC, who is in battle with the player, will open that door and ruin the sequence (he is carrying the key that the player is supposed to use on that door).

 

I've tried various default scripts and xmarker enabled collision markers etc to no avail.

 

Any idea how to keep him from opening that door?

 

Thanks!

Link to comment
Share on other sites

I figured out how to make it so a key is added to the actor upon his death.

 

In case someone comes across this post, and has the same need, here it is:

 

Scriptname CustomAddItemKeyOnDeathScript extends Actor  
{Adds only a key to the actor.}

Key property _KeyToAdd Auto

auto STATE WaitingToBeActivated
Event OnDeath(Actor killer)
       Self.AddItem(_KeyToAdd)
EndEvent
EndState

STATE done
       ;done doing stuff
endSTATE

 

As it says in the script, it will ONLY add a key to the actor upon his death. This will keep him from opening a door that you may not want him to open because he has the key to it.

 

Cheers!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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