Jump to content

Locked door question


TheArc

Recommended Posts

You could have a script that would only allow you to open the door with a certain key. I'm terrible at scripting but I'm pretty sure it would be easy to do. Just have the script check if you have the key when you try to open the door. If you don't, a message box could pop up telling you that you need the key to open the door, and if you do have the key the door would open. At least I think that would work....
Link to comment
Share on other sites

...Like so...

 

Begin "#mws_scpt_door_OMFG_LIEK_TEH_DOER_2_OBLEVEON"

 

; Because I can, damnit!

 

short Opensesame

 

If ( Opensesame == 1 )

Return

ElseIf ( OnActivate == 1 )

If ( Player->GetItemGount XXX > 0 )

Set Opensesame to 1

Activate

Else

MessageBox "YYY"

Return

EndIf

EndIf

 

End

 

...Where XXX is the ID of the key and YYY is the message you want displayed when the PC attempts to open the object without a key (The MessageBox command and its YYY argument can be removed without any negative consequences -- alternatively, you can replace the line with any command or series of commands you wish to execute).

 

If you want to detect if the PC has used a lockpick on the object, there's a variable or two that you can access for that purpose that's added in the Bloodmoon expansion -- see the script on the desk in a room above the Fort Frostmoth armory for an example of this.

Link to comment
Share on other sites

Here is am example from Prison Ship Escape mod.

 

begin darken_doorscript

 

if ( OnActivate == 1 )

if ( Player->GetItemcount, "_darken_lower_key" == 1 )

Activate

 

else

MessageBox "You need the Darkenhold Lower Prision key to open this door"

endif

 

endif

 

End

Link to comment
Share on other sites

I see........

 

Well then just use the above mentioned methods. Except for you have to ad one thing: Make the door trapped, D&D style. That way, if anyone without the key tries to open it, a massive rift opens in front of the door, and sucks the person in. Soon, they are located in a massive pit of fire, doomed to burn undying for all eternity..... :halloween: :halloween: :halloween: MWAHAHAHAHAHAHAH! :halloween: :halloween: :halloween:

 

Sorry, been hittin up on the old brownies again....... :innocent:

Link to comment
Share on other sites

No no people! If you don't want to have a key open a door, just go to Misc items and make an Item that might be what ever you want, then go to the doors properties by double-clicking on the door and say Locked and choose your item or key. You don't have to use a script! Only if its not a Door.
Link to comment
Share on other sites

  • 2 weeks later...

Archived

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

  • Recently Browsing   0 members

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