How to make a door open when you step on a button

thank you so much for your help

its not letting me change the transparency of the door do you know why?

Where you set the CanCollide, also do Door.Transparency = 1 (to make it transparent)

nvm I found it I just had the wrong properties

sry how would I make it so there are multiple doors and multiple buttons so 1 button won’t open all the doors

You can put a script in each door to do that.
Have a look at how I scripted the swinging door in my post above, you can see how I used the input from the Part that’s being stepped on to activate the door.

If you want i can do a model with 2 doors and 2 button for you to understand how it works to open one door with one button and the other one with another button. It’s pretty simple you’ll see.

ok that would be great I was trying to rename the door to door1 and change all the “door” in the script to “door1” but it didn’t work

I need 5 doors so it would be great if you could do that

local doors = yourfolderherefordoors
local Parts = yourfolderhereforButtons
debounce = false
while wait() do
for i,v in ipairs(Parts) do
v.Touched:Connect(function(hit)
local IsPlayer = hit.Parent:FindFirstChild(“Humanoid”)

if IsPlayer and debounce == false then
debounce = true
local DoorToWorkOn = doors:FindFirstChild(“door”…v.Name)
DoorToWorkOn.Transparency = 0.5
DoorToWorkOn.CanCollide = false
wait(3)
DoorToWorkOn.Transparency = 0
DoorToWorkOn.CanCollide = true
end
end
end
end

Alright I’ll give you a model in like 1 hours.

This script is good but not really understandable, can you make it cleaner so it can be understandable by someone who doesn’t know how to write a script?

ok thx

Oh yea im writinng on mobile. My PC just had Disk Issues so it was due a repair. But it will get aligned properly in studio.also about my script.
If a player already touched the part then it wont work if another player tried to open it

oh alright i didnt know, hope you’ll get it soon

Alright here’s the model :

I hope it helped, have a great day!

https://www.roblox.com/library/9392568870/OpenableDoor-v2

thank you so much

1 Like