Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how do I make like two pressure plate and when a certain two blocks hit them they open a door?

I wanted to make two blocks when both of them are on the two platform (part) they will open a door and they can only open the door if they are on together. I tried an if statement, it didn't work. So please could some one help me. I have deleted all the script that i made so could someone tried to help me and make a script or help me in some way

1 answer

You have to make a .Touch function that will turn a value for example:

Part1isonbutton = true

and when the part is the other Part then

Part2isonbutton = true

and then check if both values are true in the same function and if so then the button moves/tweens down and the door opens.

and when .TouchedEnded happens then the part who stopped touching goes liek Part1isonbutton = false and then check if the other one is true then move the button up again and close door

3 comments

1

Ayo perfect explanation!

0

ok so should i need to set a value on a the block when it is hit?

0

Yeah a value for eachblock and then unset the value after touchended

This discussion is preserved as it was. New answers, comments, and votes are closed.