I asked a similar question a few days ago, But now I'm trying to do the same with a SurfaceGUI, I've been using the exact same script but it doesn't work? (Only in Studio..)
There's no outputs and I've tried this in both a Local Script and Normal...
local groupid = 1196447
script.Parent.MouseButton1Down:connect(function(clicked)
local plr = game.Players.LocalPlayer
if plr:IsInGroup(groupid) then
if plr:GetRankInGroup(groupid) >= 2 then
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.MainMenu.Visible = true
else
print("Player is not in group or does not have significant permissions")
end
end
end)

2 comments
I just tested this, and all this seems to do is crash the game? :x
I tested it in game and in studio, didn't have an issue.