I havent tried anything yet i just wanted to know how to make a door clickable then it will open, stay open till i click it again then it closes
** UPDATE:**
Please provide a script for it, I have the door all made and I just need the script and i need to ask, Do you need to use hinges, If so which ones?
Put a ClickDetector inside the door brick along with this script.
01 | Click = 0 |
02 | script.Parent.ClickDetector.MouseClick:connect(onClicked) |
03 | function onClicked(playerWhoClicked) |
04 | if Click = = 0 |
05 | script.Parent.CanCollide = true |
06 | script.Parent.Transparency = 0.5 |
07 | Click = 1 |
08 | else |
09 | script.Parent.CanCollide = false |
10 | script.Parent.Transparency = 1 |
11 | Click = 0 |
12 | end |
13 | end |
Please answer and if possible please do provide a script so it helps me rewrite it more and give credit to the maker, Thanks