I need help in opening a specific door! (SOLVED)

I am brand new to coding and flowlab. I made a game for my students. It involves collecting 5 keys by answering multiple choice questions and getting the right answer key. There is a door that takes you to the next level, but it will only open if you have all 5 keys. When you collide with the door, it says an alert “This door is locked. Find all 5 keys to go to the next level!”
My issue is that I cannot get the door to open or advance to the next level effectively. I tried sending a message from the right answer key to the door, but when you get the 5th key, you automatically go to the next level, which is not what I want. I want my students to be able to get all 5 keys, come back to the door, collide with the door, the door opens, and then you go to the next level. How do I get the door to open only when you get all 5 keys and only at the door?
Under the door behaviours, I have “Mailbox: Right Key” (message from the correct answer key) output to “Number- 1” in the “get” slot, then output to “Number: 0” in the “+” slot, then that is connected to “Filter” in the “in” slot with it set to “equal to 5”, then its “pass” is connected to “Next level” in the “go” slot. I also have the “Filter: pass slot” connected to the “Animation: start” slot so the door can open.
I really appreciate your help with my game!
Here is the link to my game: Flowlab Game Creator - Sprite World

2 Likes

If you could provide a link to your game, I’d be happy to help you!

1 Like

Hi! Thank you so much for replying so quickly! Here is the link:
Flowlab Game Creator - Sprite World
Level 2 is the key level

2 Likes

Doing this should solve your problem. When the conditions are met, the switch allowing the level transition will be turned on. Once the player collides with the door, the transition will occur.

2 Likes

Wow! Thank you so much! I am very grateful for your help! I will implement your technique now.

2 Likes

I just tried it and it didn’t work. I got this message still after getting all the keys. Any other suggestions?

1 Like

You’re sending the message to the player object only. You need to send it to the door, as well, so that it can log progress on the keys.

2 Likes

Ok, I sent the message to the door as well, and it WORKED!!! Thank you so much!!! Have a lovely day and/or evening!! God bless.

2 Likes