Argument 1 or missing nil

I want this to work in multiple groups if they are above the ID but dont work:

local groupsandid = {
	{GROUP = 12449769, ID = 7}, 
	{GROUP = 12379811, ID = 3}, 
	{GROUP = 13256416, ID = 250}, 
	{GROUP = 12379828, ID = 10}, 
	{GROUP = 12411787, ID = 247}, 
	{GROUP = 11674733, ID = 247}, 
	{GROUP = 12477398, ID = 1}, 
	{GROUP = 12477340, ID = 3}
}

script.Parent.Triggered:Connect(function(p)
	if p:GetRankInGroup(groupsandid.GROUP) >= groupsandid.ID then
		for i,pads in pairs(script.Parent.Parent.Parent:GetChildren()) do
			pads.CanCollide = not pads.CanCollide 
			pads.Transparency = pads.Transparency == 1 and 0 or 1
		end
	end
end)

Error in

if p:GetRankInGroup(groupsandid.GROUP) >= groupsandid.ID then

You’re making an array called “groupsandid” then you’re storing more arrays inside it. If you wanted to get the first item in “groupsandid” then you would have to call groupsandid[1]. When you call p:GetRankInGroup(groupsandid.GROUP) it’s looking for a property named GROUP which doesn’t exist. I’m not completely sure what you’re trying to do here because you’re not differentiating between groups, but a dictionary would be a better thing to use here.

local groups = {
    [12449769] = 7,
}

Doing it this way, you can access a group by indexing the groups’ id which will give you the rank ID.

groups[12449769] == 7