The first script says that when someone steps on a brick called Button, another brick called Door will become transparent and walkthrough. The second one says that when someone clicks a part called Button, the part called Door will open. Will these work? [EDITED BY DUMMIEZ]
First script (Button Touch Door)
local debounce = true
function onTouch(Button)
if debounce and Button.Parent:FindFirstChild("Humanoid") and Button.Parent.Name == game.Players:findFirstChild(Button.Parent.Name) then debounce = false
game.Workspace.Door.Transparency = 0.5
game.Workspace.Door.CanCollide = false
wait(5)
game.Workspace.Door.Transparency = 0
game.Workspace.Door.CanCollide = true
debounce = true
end end
script.Parent.Touched:connect(onTouch)
Second script (Button Click Door)
H = game.Workspace.Door
local debounce = true
function onTouch(Button)
if debounce and Button.Parent:FindFirstChild("Humanoid") and Button.Parent.Name == game.Players:findFirstChild(Button.Parent.Name) then debounce = false
function onClick(Button)
H.Transparency = 0.5
H.CanCollide = false
wait(5)
H.Transparency = 0
H.CanCollide = true
end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

3 comments
Thank you Dummiez :D
I edited the first and second scripts
Yes these should work, make sure to put debounce = true in the second script or else it will always be false.