Blog #11.5

So here is the shelf that we will hide stuff in.

Here is the code:

As you can see, I used the click detector again (line 33). You are probably wondering what a CFrame is (line 11). The CFrames essentially describes the position of a 3D piece. It takes place when I click on it. You can see is position changing. When I click on it, it changes a value to false or true to tell if the shelf is open or not.

Key System:

Here is the code:

So when a player is holding out a tool named “Key”, it turns the transparency to 0.5 making it slightly visible. It then sets CanCollide to false, allowing the player to walk through. It waits 1 second and resets what just happened. As you saw, I can only open the door with the key out.

Leave a Reply

Your email address will not be published. Required fields are marked *