Openng secret Door

I have redone the code. the sound effect doesn’t work & still cant get thru the door.

Openng secret Door - Help Requests - Flowlab Community

I have to do 2 sets of code?

Openng secret Door - Help Requests - Flowlab Community

I dont quite understand

I.m not sure where the in wire goes to. Your diagram is a bit confusing

You need to wire the second “Collision” behavior to the “get” of the “Number” which has the value -1, and wire the “pass” of the “Filter” to the “in” of “Switch”. Also yeah, you need 2 sets of code for 2 different objects which is the player and the door.
Screenshot 2024-05-12 3.29.40 PM

And the “Filter” should be “greater than or equal to” with value is “1”.

Because you need to send a message from the Key to the door when the players collects it.
You send a message from one object, and the other object will get the message from the mailbox.

Message → Mailbox


I’ve done that & still doesn’t work

What does that exactly do?

When you collect the key, you send a message “Key” to the door.
With the code in the door, the mailbox with “Key” would turn on the switch,
so when the player touches the door, it would open.

This is what I got right now

Openng secret Door - Help Requests - Flowlab Community

Oh, that will work too. Just set the message to “Key” and set the bottom option in the message to “Secret Door” and “Any Object”. But something looks wrong that I don’t think would allow it to work. Try this instead in the player.

In this changed code, you want to make sure that touching the door only counts down how many keys you have when you have more than 0 keys. Also if you plan to having multipple doors or unlockables, you can set the message to “Send to last contacted object”. That will send the message to the last object that activated the collision.

Now the door works either with or without the key. Almost there. Any Suggestions?

Well there are 2 issues with that:

  1. The false output of the filter is turning the switch on.
  2. You should update that code to what I showed above.

Thank u very much. It works Perfectly now. :slight_smile:

1 Like