Opening looked door with a item.

callum_lockley
03 Jan 2016, 15:45
Hi in my game I was looking to have a room which can only be opened with using a key that the player would pick up in another room. However I am not sure how to do this so could someone please help me on how to do this.

OurJud
03 Jan 2016, 16:06
Here's a very simple example - two rooms, with a single exit back and forth. That exit is locked. Also in the room you have a key.

So, go to the 'exit' tab on the room with the locked door, click on the exit at the bottom where it says 'To' and 'Alias', then click 'Edit'.

Then make the UI look this this:

lockedroom.jpg


If you'd rather use code, click the tab I've highlighted and add this:

if (Got(key)) {
MoveObject (player, room 2)
}
else {
msg ("That door is locked")
}