RedEagle_P1. 905 Posted November 24, 2018 How can I make it so that when a player interacts with an entity a question pops up that, if answered correctly (secret code) it allows the user to get an item? @Khanecz @spyler.1989 @Houp @Oliver Hope_P1 Share this post Link to post Share on other sites
Fompster 141 Posted November 24, 2018 (edited) Hey Red, First of all you need to get the item that you want to interact with and set it to unpickable. Due to this you need to create a new interaction in that object's script and say what you would like to happen once the player does interact with it, in this case you want to ask a question. In the "Ask Player" script you want to specify what the password is and if it is right then you spawn whatever item you want (stored in an "Entity Template") . The player's inventory is the container container. Seems that I have misread the question at first so here was my initial response (it felt like a waste to delete it ): If you want a chest to only unlock when a player gives the right password then similar principles apply. First you need to create an "Ask Player" feature where you create a password variable and an if statement that checks if the password is correct. Create a chest and set it to "Locked". Within the chest script you need to create a new interaction otherwise your character will constantly get an error message for not being able to open the chest. Then once the character interacts with it, you should turn the interaction off so that once you do type in the correct password, you are able to open the chest. If you want the chest to be constantly open after you have written the correct password then you can delete the stuff under the "On Close" section in the chest script since that serves as a reset mechanism. Hope that helped! Edited November 24, 2018 by Fompster_P1 1 1 Share this post Link to post Share on other sites
RedEagle_P1. 905 Posted November 25, 2018 Thanks so much @Fompster_P1 Share this post Link to post Share on other sites
Igor Q. 519 Posted November 26, 2018 I would have made the code in a different way :V You can set up "Enable interaction" with an object, in this case opening a dialogue You can set up 9 options (numbers 1 to 9) And set up the string for the dialogue prompt to be the inputted code. If String = Code, then the chest will open. Share this post Link to post Share on other sites