Can someone help with a disappearing door?
Well I know it would be easy to make a door disappear and reappear by using an onTouch function and setting it's can-collide to be false and its transparency to fade to 1. But I need help. Is there any way that I can have a tool in my starterpack where if I click, the door dissappears, but if I click again, the door reappears? I already know how to do the script for the dissappearing part and the reappearing part, I just need someone to point me in the right direction.
Also, if this is not possible, I can settle for a button where if I click, it fades and if I click again, it reappears. I just don't know the function for it.
This is my fading script using an onTouch function. Hope that helps somehow.
05 | Brick.Touched:connect( function (part) |
13 | Brick.Transparency = Brick.Transparency + . 1 |
21 | Brick.Transparency = 0 |
01 | local Brick = script.Parent |
05 | Brick.Changed:connect( function (prop) |
07 | if prop = = "Transparency" then |
09 | if Brick.Transparency > = 1 then |
11 | Brick.CanCollide = false |
15 | Brick.CanCollide = true |