Group rank script

Hey there,
my code for a group changer doesnt work here it is:

local GroupId = 9423809

local MinimalRank = 200

local Dev = BrickColor.new("New Yeller")

game.Players.PlayerAdded:Connect(function(Player)

if Player:GetRankInGroup(GroupId) >= MinimalRank then

Player.TeamColor = dev

else

end

end)
1 Like

ok ill try it out thank you :slight_smile:

ok done that let me a test of that now

ok that doesnt seem to work i tested it on my alt it can still team me as a dev on the main menu

ok here:

local GroupId = 9423809
local MinimalRank = 200 
local Dev = BrickColor.new("New Yeller")
game.Players.PlayerAdded:Connect(function(Player)
	if Player:GetRankInGroup(GroupId) >= MinimalRank then
		Player.TeamColor = Dev
	else
	end
end)

Do you have a team with the same color?

Also, else isn’t necessary here

1 Like

yeah the dev team has the same color as what’s on the script

I see the error on the script I have a team rank script.

Try this:

local GroupId = 9423809
local MinimalRank = 200 
local Dev = BrickColor.new("New Yeller")

game.Players.PlayerAdded:Connect(function(Player)
	if Player:GetRankInGroup(GroupId) >= MinimalRank then
        print("Player is a dev")
		Player.TeamColor = Dev
	else
        print("Player is not a dev")
	end
end)

The Player.Team documentation says that if there’s no team with the associated color, the player won’t be given a team

ill try out that script right now :smiley:

right it wont work on studio but it will work ingame

1 Like

Try this I haven’t tested it yet.

game.Players.PlayerAdded:Connect(function(plr)
    if plr:GetRankInGroup(9423809) >= 200 then
        plr:TeamColor = brickColor.new("New Yeller")
        end
    end)
    
    game.Players.PlayerAdded:Connect(plr)

Make sure its in the ServiceScriptService and its a local script. I’d create a folder so it doesn’t get messy if you add more scripts.

Yeah, my bad did you test it yet?

yeah i tested it it is still broke welp

There’s another way to do it if you want.

1 Like

yeah can we do that way please :smiley:

Let me see what the error says first.

W001: (7,34) Unknown global ‘plr’ W001: (3,19) Unknown global ‘brickColor’ that is it

Alright so go back to your script try testing that tell me what it says make sure that your team color is the same one as the script.