Ok so there are three parts to my gate. Two buttons and the actual gate.
So it always worked fine, but recently i wanted to change it so it would be collideable and visible when I pressed a button. But what ended up happening was the button would not function but the button which made the gate disappear and non collideable worked.
These are the lines of the code.
Button 1
local groupId = xxxxxxx -- group id
local minRank = 254
local gate = script.Parent.Parent.Gate
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
if plr:GetRankInGroup(groupId) >= minRank then --if its equal or greater than
gate.Transparency = 0
gate.CanCollide = true
end
end)
Button 2
local groupId = xxxxxx -- group id
local minRank = 254
local gate = script.Parent.Parent.Gate
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
if plr:GetRankInGroup(groupId) >= minRank then --if its equal or greater than
gate.Transparency = 1
gate.CanCollide = false
end
end)
Once again the factors that i changes where the material of the brick, i made it into Ice, and certain characteristics of it so it behaved like ice. And in button 1 i changed it so the transparency was 0 not 1.
If anyone could help it would be much appreciated!

2 comments
The Gate is Anchored though.
Open up your Output, when you start the game or press either of the buttons, do you get any
errormessages?