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.
Brick = script.Parent
fading = false
Brick.Touched:connect(function(part)
if not fading then
fading = true
for i = 1, 10 do
Brick.Transparency = Brick.Transparency + .1
wait(.1)
end
wait(2)
Brick.Transparency = 0
fading = false
end
end)
local Brick = script.Parent
Brick.Changed:connect(function(prop)
if prop == "Transparency" then
if Brick.Transparency >= 1 then
Brick.CanCollide = false
else
Brick.CanCollide = true
end
end
end)

2 comments
Thank you, this seems like it'd work like a charm. However, one quick question. Where would this script be places? In other words, what would its parent be?
It would be a child of a Tool. If I answered your question, please mark it as accepted and upvote!