I am trying to make a keybind door that opens when [E] is pressed. It would check if you have a specific keycard for example. So lets say I have keycard A it would open the door and say "Successfully opened door" and my friend has keycard B and it would not be the correct clearance and it would say "Too low of a clearance". How could I create something like this?
How to make an E to open door that only opens for specific tools?
1 answer
Let me explain how things need to be set up...
First what you'll need to do is get a LocalScript and have it determine 1. Which door should be 'unlocked'. 2. A gui show up on the 'Selected Door' 3. Fire and event to the server which door needs to be unlocked
Server Script to handle server sided things 1.You need to get that Event when it's fired and unlock the door 2. Before you can unlock the door, you need to see if they have a keycard that will work.
I actually made a model for you. It involves command 'givekey' & 'takekey'
Give it a shot, I have instructions for you aswell!
Have any questions let me know
2 comments
What if I would want multiple keycards to open one door? For example the door I have is named "KeycardDoor" and I want it to open for multiple keycards.
In the Keycard Model above, Keycard 'A' Can open everydoor. while keycard 'D' can NOT open doors 'A' 'B' or 'C'
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
just in door script add a function to check the keycard is it allowed like if keycard == A then --[[script that open door]] end
or simply check if the player has a tool in his backpack or character called "keycard" , then ----