local groupid = -- I put the ID here, taken out for the purpose of this question
script.Parent.MouseButton1Click:connect(function(clicked)
local plr = game.Players:GetPlayerFromCharacter()
if plr:IsInGroup(groupid) then
if plr:GetRoleInGroup(groupid) >= 2 then
script.Parent.Parent.Parent.Parent.Visible = false wait(.1)
script.Parent.Parent.Parent.Parent.Parent.MainMenu.Visible = true
else
print("Player is not in group or does not have signifficant permissions")
end
end
end)
This is a script that when a player clicks the button, it will see if they have the right permissions (Role 2 or more) and if they do it will move onto the next screen, but it doesn't work.
It outputs this every time; Argument 1 missing or nil
Any help would be much appreciated..

2 comments
Thanks for your answer, However, this seems to only work in studio and not in the actual game? x3
You must be using a LocalScript as you are using the LocalPlayer as the plr variable.