Here is my module script I get the data from: It has no issues but it may be useful for defeating the problem:

local TeamMetaData = {
	{6283819,
		{
			"Guest",
			"Citizen"	
		}, 
		{
			"High Class Citizen",
			"Citizen",
			"High Class Citizen"
		},
		{
			"Federal Employees",
			"Citizen",
			"Federal Employees"
		}

	}
}

return TeamMetaData

And here is my script with there error: The error is on line 7, it is a local script.

Ranks = require(script.Parent.Parent.CONFIG)
AccesibleTeams = {}
AllreadyThere = false
for a, b in pairs(Ranks) do
    GroupRank = game:GetService("Players").LocalPlayer:GetRoleInGroup(Ranks[a][1])
    for c, d in pairs(Ranks[a]) do
        if GroupRank == Ranks[a][c][1] then
			 for e = 2, #Ranks[a][c] do
				for i, v in pairs(AccesibleTeams) do
					if AccesibleTeams[i] == Ranks[a][c][e] then
						AllreadyThere = true
					end
				end
				if not AllreadyThere then
					table.insert(AccesibleTeams, #AccesibleTeams + 1, Ranks[a][c][e])
				end
           		end
		end
	end
end

Sorry if some formatting is wrong, roblox formatting is broken.

1 comment

0

For the future give your variable names clearer meanings. I'm struggling to understand what every a,b,c,d,e means.