Jump to content

Door close and open on Boss kill script.


Maverick11

Recommended Posts

To close the door you're best using a trigger with a script attached (Event OnTriggerEnter)with an object reference property that points to your door. You can set the door to closed by the statement "MyDoor.SetOpen(false)" inside the event of the script. To lock it, also add MyDoor.Lock()

 

To open it again after the boss death you could attach another script to the boss with an OnDeath event with the statement mydoor.SetOpen(true)...MyDoor.lock (false)

 

P.s. ck does have a simple door close script.. just search for "door" in the script search window. Hopefully that will give you an understanding of how it works.

 

Alternatively you could use quest stages too

Edited by skinnytecboy
Link to comment
Share on other sites

I probably should have been a little more specific. I need an animated door to close behind. Like gates for example. If I attach the script to a gate and go through the trigger, will the door close behind me and lock? I'll check it out anyway. Thanks.

Link to comment
Share on other sites

I probably should have been a little more specific. I need an animated door to close behind. Like gates for example. If I attach the script to a gate and go through the trigger, will the door close behind me and lock? I'll check it out anyway. Thanks.

Could put something like this on the triggerbox

 

 

 

 

Scriptname doorclosescript extends ObjectReference  
{closes and locks a door upon player entering a triggerbox}


ObjectReference Property MyDoor  Auto
Bool Property doOnce = TRUE Auto

Event OnTriggerEnter(ObjectReference akActivator)
    if(game.GetPlayer() == akActivator) 
     MyDoor.SetOpen(false)
	 MyDoor.Lock(true)
	 doOnce == true
		
	EndIf
	 
EndEvent


  

 

 

 

And this on the actor you want to kill

 

 

 

Scriptname doorscript extends Actor
;This Script opens a portcullis on actor death

ObjectReference Property MyDoor Auto

Event OnDeath(Actor akKiller)
    If (akKiller == (game.GetPlayer())
        MyDoor.SetOpen()
    endif
EndEvent

 

Edited by Aragorn58
Link to comment
Share on other sites

  • Recently Browsing   0 members

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