How do I add multiple group ranks to my auto tools code?

What I need help with is a script that I use in order to assign specific group ranks tools. I want to know how to add a table that can add multiple ranks and tools to one statement to avoid clutter. Also, for some reason the script does not work after I added more group ranks to it. For some reason it will only work for one group rank, I need it to work for multiple groups ranks and tools. I will provide an image below in order to assist you with assisting me.

A simple way to do what is needed is to make a table with all the ranks that get the cuffs tool and when a player is added, check if their rank is found in that table and if it is, give the cuffs, something like this basically

local Cuffs = --Your cuffs
local groupId = --Your id

local ranks = {
	254,
	200,
	195,
	--Continue with your other rank numbers
}

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Wait()
	if table.find(ranks,plr:GetRankInGroup(groupId)) then
		Cuffs:Clone().Parent = plr.Backpack
		Cuffs:Clone().Parent = plr.StarterGear
	end
end)

Cloning to StarterGear is good as well so the player will still have the cuffs after a respawn

2 Likes

So this should work?

1 Like

I believe so as it’s not outputting/showing any errors