GetRankInGroup using tables

What is the issue? image

	local Groups = {13016458,15331112,15332038,15692214,11297312,14565071}

	local Ranks = {8, 11, 16, 19, 237, 241, 242, 243, 245, 255}

	game.Players.PlayerAdded:Connect(function(plr)
		if not plr:GetRankInGroup(Groups[2][3][4] >= Ranks[6]) and plr:GetRankInGroup(Groups[2][3][4] <= Ranks[8]) then
				print("You don't have permission to run this command")
			end
		end)

How do I make this script, not error?

if not plr:GetRankInGroup(Groups[2][3][4] >= Ranks[6])

instead make sure you close the plr:GetRankInGroup(Groups[2][3][4])

same with the plr:GetRankInGroup(Groups[2][3][4] <= Ranks[8])

Same error comes up I’ve tried it already before

I think you can’t put more than one array.
Because you put [1][2][3] which may come up with an error.

I can if I try it without the arrays and just put 123,123,123 it’ll work perfectly fine

:GetRankInGroup(15331112,15332038,15692214) <= Ranks[8]) 

U see this statement right here won’t show any errors

I want to use tables to save time and place inside of the script

maybe try something like Groups[1], Groups[2]. When I tried in Roblox studio it also gave the same error, however, this error was resolved when I did that.

I think I’ve just found the solution

Ye lol #30sigjsjigvkjsfsfgsafgssgv

I think I found a solution.
So you need to add an another table.

What for #w988510571909767830936

This is what I put and it comes up with the groupId’s and RankId’s.
image

It doesn’t work I know what you’ve tried to do but the issue doesn’t come from the tables the issue is from how the :GetRankInGroup reads the table

This doesnt have to do with the :GetRankInGroup this is just how you would something from a table, as I used print(Groups[1][2]) and I still had the same error.

1 Like

Mhm what I was trying to say is that you can’t take more than one array from the table and try to use altogether without separate it, it’ll just error as it combines two of the arrays together