Button
--Button
local button = script.Parent
-- Reminder: Replace the name of the part, Gate, with the one in your project
local gate = game.Workspace.Gate
local function buttonPressed()
print("button touched")
-- Changes button to red to give player feedback
button.BrickColor = BrickColor.Green()
-- Make the gate invisible
gate.Transparency = 1
-- Makes it so the player can walk through the gate
gate.CanCollide = false
end
button.Touched:Connect(buttonPressed)
Button1
local button1 = script.Parent
-- Reminder: Replace the name of the part, Gate, with the one in your project
local gate = game.Workspace.Gate
local function buttonPressed1()
print("button close touched")
-- Changes button to red to give player feedback
button1.BrickColor = BrickColor.Red()
-- Make the gate visible
gate.Transparency = 0
-- Makes it so the player can not walk through the gate
gate.CanCollide = true
end
button1.Touched:Connect(buttonPressed1)
E to Open the Doors Assets: https://www.roblox.com/library/6690395183/E-to-Open-Doors