Help Making A Door System

So i’ve been trying to make a particular door system which i rlly liked but didn’t know how to make it’s feature.Here is a showcase of what i mean :

As you can see you can open/ close the door Lock it or even break it!
If anyone can help me make that it would be rlly appreciated!
If you want more detail on the Breaking (You should press E to break multiple times to break the door)

3 Likes

Use ProximityPrompts to do this.

Make functions for the ProximityPrompts and use TweenService or another way to open the doors (Such as Constraints).
With breaking it, use ProximityPrompt events and you could change anchored to false, or you can make it more advanced.

Events:

PromptTriggered -- Fires when a player interacts with a prompt (after the duration for a prompt with non-zero HoldDuration).
PromptTriggerEnded -- Triggers when the player stops interacting with a prompt.
PromptButtonHoldBegan -- Fires when a player begins interacting with a prompt of non-zero HoldDuration.
PromptButtonHoldEnded -- Fires when a player stops interacting with a prompt of non-zero HoldDuration
2 Likes

I think you were talking about locking because anchoring the door is like if it’s locked.
If you didn’t then can you explain more how would i go about making the breaking system?

No, I was not talking about locking. I was talking about opening, closing, and breaking. If you want to do a lock system, then you can use a ProximityPrompt function. Once the ProximityPrompt is triggered, then you can set a boolvalue to true. At the start of the function, you can check if the bool value is set to true or false to check if it is locked or unlocked.

As i said can you explain more how to make the breaking system pls?

Well, you can use a ProximityPrompt function. Once that is triggered, then you can set anchored to false and break welds (if needed). You can make it more advanced with TweenService if you want.

1 Like

Use can use Proximity Prompts to code what happens when the player opens the door.

You might need to use RemoteEvents to fire this to the local player. The local script should be inside StarterPlayerScripts. A server script inside the proximity prompt can fire the event. TweenService can be used inside the local script and the sound can be placed inside the local script.

I haven’t tested but you can try!

1 Like

Ok then thx to both of you for your help i’ll start making the system and if i’m stuck at anything i’ll be sure to tell you.Thx again!

1 Like

I got one more question should i use body force for when the break proximity prompt is trigered? (Just to make it Fly backwards).

Yea sure, it just depends on how you want it to look. If you want to change the speed or gravity of the object, then you can use BodyForce.

Like how can i make it throw backward when the proximity prompt is triggered? (Using body force)

You can’t just use Bodyforce for making the part move like that.
Bodyforce is mainly used for changing gravity.
For moving the part back like you said, you can use TweenService and change the TweenInfo for speed, or you can use Vector3 to move the part.

Also it seems like a good idea to use Velocity in this case.

ok thx i’ll try making it and hopefully it works.

1 Like