How Would I Make This To Be A Group Script

Hello, I need help on making this so that I don’t have to put in the usernames and just make it so if they are in the group and have a specfic rank or role they would have access to the panel.

local module = {"Player USername"}

function module:CheckWhitelist(plr)
	local iswhitelisted = false
	for i,users in pairs(module) do
		if users == plr then
			iswhitelisted = true
	return iswhitelisted
return module

its an admin panel.

local whitelist = require(game.ReplicatedStorage:WaitForChild("Whitelist"))
	local iswhitelisted =whitelist:CheckWhitelist(plr.Name)
if iswhitelisted == false then return end

That’s what the whitelist function does

You need to use GetRankInGroup.

ohhh I got it now, I don’t need to rewite it I can just make the person white listed if they are in rank thanks.