I would like to make a team gui which allows you to join a team only if you are at the rank in the group

I would like to make a team GUI which allows you to join a team only if you are at the rank in the group can someone please help me.

PS I know its in the wrong category

1 Like

I’m pretty sure this should be in #help-and-feedback:scripting-support

I know but know one responded :frowning_face: :slightly_frowning_face:

That’s not how the devforum works. You have to follow the rules.

1 Like

It doesn’t matter on how much people respond you just need to use the right category.
And you never know, sometimes people can use one category more than the other. or it’s because your asking someone to make you a script.

Can you post the script you have so far?

local groupid = 4558154 – Change this to your group Id

– Editable settings
local rank1number = 3 – A rank
local rank1color = BrickColor.new(“Br. yellowish orange”) – The rank’s team color

local rank2number = 4 – A rank
local rank2color = BrickColor.new(“Br. yellowish orange”) – The rank’s team color

local rank3number = 255 – A rank
local rank3color = BrickColor.new(“Br. yellowish orange”) – The rank’s team color

game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(groupid) == rank1number then
plr.TeamColor = rank1color
elseif plr:GetRankInGroup(groupid) == rank2number then
plr.TeamColor = rank2color
elseif plr:GetRankInGroup(groupid) == rank3number then
plr.TeamColor = rank3color
end
end)

local playerids = {399226415,672066091}

game.Players.PlayerAdded:Connect(function(player)
if playerids[player.UserId] then
print(“A developer joined”)
end
end)

ok i will chan :grinning: :smile:ge it

I meant if this was like a model. Did you change the player ids/ team colors?

no i made it i just made up some ids

-- fixed by 9h60

local group = 7958564 -- your group ID

local rankcolors= {
    [3] = BrickColor.new("Light Yellow"),
    [4] = BrickColor.new("Brick Yellow"),
    [255] = BrickColor.new("Grey"),
}

local devs = {
    [399226415] = true,
    [672066091] = true,
}

game.Players.PlayerAdded:Connect(function(player)
    local rank = player:GetRankInGroup(group)
    
    if rankColors[rank] then
        player.TeamColor = rankColors[rank]
    end
    
    if devs[player.UserId] then
        print("Dev joined: " .. player.Name)
    end
end)

thx :smile: :grinning: :smiley:

Your welcome! Also use this group id 7958564
You were a admiral in that group. So change one of the rank numbers to the admiral rank.
If you don’t know the admiral rank number, it’s 253.

ok :smiley: :smile: :grinning:

so where should i put the sript

wait never mind :smile: :grinning: