How do I create this kind of door?

If you have seen my last post , you may know I’m working on a piggy game

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? An invisible door that when you use the correct key on it , it will become uncollidable

  2. What is the issue? I do not know how to make this kind of thing

  3. What solutions have you tried so far? I tried looking for tutorials on youtube and the forum , neither worked

So here’s the plan :

I already have my own tap to open door

I want to make a locked door that is invisible

I also want to make a lock

If I use the correct key , the invisible door would become uncollidable , the lock will fall on the floor

You still need to click the actual door after using the key

I still have tons to learn about scripting! No need to tell me the whole script though , if you want , that’s fine! I just need to know how the using tool to make door uncollide thing and also the lock becoming unanchored

Sorry, forget to read the end.

Ok, I don’t actually know how to script but I’m good with the logic of it so I could possible be wrong but I think you should write it like this:

When the player joins the game, set the door to collisions on, put the lock in place, and anchor the lock

If the key is in the player's inventory, then when the door is clicked set the door to collisions off and set the lock to unanchored

End

All I know in actual code is that you need to put those “local get wordspace.door” and things like that at the start. I hope this could help.

Maybe this works?

script.Parent.MouseClick:Connect(function(plr)

local Tool = plr:WaitForChild("Backpack").Key or plr.Character:WaitForChild("Key")

if Tool then

--Script

else

--Script

end

end)
2 Likes

Thanks for the comments , I’ll tty them out after school

I don’t get it?

So the parts where is says “–Script” That is where I am supposed to put my own script?

But as far as I tried , it didn’t work

I made a door myself that you have to unlock and then you can open it. I am sending you an RBXM file below.

Door.rbxm (4.3 KB)

1 Like

Sorry for the late reply but , when I clicked it on drive it directed me to flipaclip , I hope this isn’t some virus or something

You definitely replied a bit later xD

The file that Sealiteq provided is a model file (.rbxm), not a place file (.rbxl). In studio, right click workspace and click insert from file, then go from there.

Alternatively, here is a place that has Sealiteq’s model included:

Door thingy.rbxl (27.2 KB)

So what happens if I download it and I don’t have drive? Because when I downloaded it on my phone , it directed me to drive , then I clicked on it , but for some reason it lead me to Flipaclip?

You won’t be able to open it from your phone, as you need Roblox Studio

Oh , thanks for telling me. I will try doing it later

More then an year later haha, but did it work?

I hope so

If not, let me know and I can modify the code in such a way to hopefully make it work