The Scripts are supposed to function for the Gate but they are just functioning for the buttons with the Scripts and ClickDetectors in them.
Opening Button Script
local Gate = script.Parent local Click = Gate.ClickDetector local function OpenGate() Gate.Transparency = 1 Gate.CanCollide = false end Click.MouseClick:connect(OpenGate)
Closing Button Script
local Gate = script.Parent local Click = Gate.ClickDetector local function CloseGate() Gate.Transparency = 0 Gate.CanCollide = true end Click.MouseClick:connect(CloseGate)
Because you had 2 scripts if you clicked, then both scripts would open and close it, so that means it would stay closed because it was closed right after it was opened. Puting it into one script will work...
local Gate = script.Parent.Parent local Click = script.Parent.ClickDetector local GateOpen = false local function OpenGate() if GateOpen == false then GateOpen = true Gate.Transparency = 1 Gate.CanCollide = false elseif GateOpen == true then GateOpen = false Gate.Transparency = 0 Gate.CanCollide = true end end Click.MouseClick:connect(OpenGate)