Group Rank For Team Script

Guys i made a script for group roles to be in team but how do i add a script for non group member to be in a team (The Impure) how do i add it in this script :arrow_down:

local groupid = 9081616

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 255 then
Player.Team = game.Teams[“High Council”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 254 then
Player.Team = game.Teams[“High Council”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 12 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 11 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 10 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 9 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 8 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 7 then
Player.Team = game.Teams[“The Brightburn Purgatory”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 6 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 5 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 4 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 3 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 2 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(9081616) == 1 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)

Please Reply fast.

1 Like

What about do all that inside of one function, just use elseif to chech if a player is a different rank.

1 Like

but i want the non group member to be a team rank

1 Like

Before all the if statements, change the player’s team, then let the if statements run.

1 Like

can u add it in the script if possible?

1 Like

u there if u there can i get the script?

1 Like
local groupid = 9081616

game.Players.PlayerAdded:Connect(function(Player)
Player.Team = game:GetService("Teams").Team -- change this with the non group member team
if Player:GetRankInGroup(groupid) == 255 then
Player.Team = game.Teams[“High Council”]
end

elseif Player:GetRankInGroup(groupid) == 254 then
Player.Team = game.Teams[“High Council”]
end

elseif Player:GetRankInGroup(groupid) == 12 then
Player.Team = game.Teams[“L.I.M.B.O”]
end

elseif Player:GetRankInGroup(groupid) == 11 then
Player.Team = game.Teams[“L.I.M.B.O”]
end

elseif Player:GetRankInGroup(groupid) == 10 then
Player.Team = game.Teams[“L.I.M.B.O”]
end

elseif Player:GetRankInGroup(groupid) == 9 then
Player.Team = game.Teams[“L.I.M.B.O”]
end

elseif Player:GetRankInGroup(groupid) == 8 then
Player.Team = game.Teams[“L.I.M.B.O”]
end

elseif Player:GetRankInGroup(groupid) == 7 then
Player.Team = game.Teams[“The Brightburn Purgatory”]
end

elseif Player:GetRankInGroup(groupid) == 6 then
Player.Team = game.Teams[“L.I.M.B.O”]
end

elseif Player:GetRankInGroup(groupid) == 5 then
Player.Team = game.Teams[“L.I.M.B.O”]
end

elseif Player:GetRankInGroup(groupid) == 4 then
Player.Team = game.Teams[“L.I.M.B.O”]
end

elseif Player:GetRankInGroup(groupid) == 3 then
Player.Team = game.Teams[“L.I.M.B.O”]
end

elseif Player:GetRankInGroup(groupid) == 2 then
Player.Team = game.Teams[“L.I.M.B.O”]
end

elseif Player:GetRankInGroup(groupid) == 1 then
Player.Team = game.Teams[“L.I.M.B.O”]
end
end)
1 Like

thank you but where to add the Non group member team name?

1 Like

I just edited the script. Change the team at the top

1 Like

ok thank you so much let me test and say if it works!

2 Likes

it shows red line will it work?

1 Like

If it doesnt work, then try this: make sure all teams have AutoAssignable set to false.

1 Like

Will not work, you did something wrong in line 4… “The Impure” is not a service, change it to this: game.Teams["The Impure"]

1 Like

Also I think you used ` for the team names, use actual quotes: "

1 Like

same again :frowning:

1 Like

Why do you put end after every if/elseif/else?

The correct syntax is:

if 1=2 then 
    print("1=2")
elseif 1=3 then 
    print("1=3")
else
    print("1!=2, 1!=3")
end
2 Likes

i cant understand can u make it as a script im not a scripter i need to make my game please help

1 Like

local groupid = 9081616

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

if Player:GetRankInGroup(groupid) == 255 then
Player.Team = game.Teams["High Council"]


elseif Player:GetRankInGroup(groupid) == 254 then
Player.Team = game.Teams["High Council"]


elseif Player:GetRankInGroup(groupid) == 12 then
Player.Team = game.Teams["L.I.M.B.O"]


elseif Player:GetRankInGroup(groupid) == 11 then
Player.Team = game.Teams["L.I.M.B.O"]


elseif Player:GetRankInGroup(groupid) == 10 then
Player.Team = game.Teams["L.I.M.B.O"]


elseif Player:GetRankInGroup(groupid) == 9 then
Player.Team = game.Teams["L.I.M.B.O"]


elseif Player:GetRankInGroup(groupid) == 8 then
Player.Team = game.Teams["L.I.M.B.O"]


elseif Player:GetRankInGroup(groupid) == 7 then
Player.Team = game.Teams["The Brightburn Purgatory"]


elseif Player:GetRankInGroup(groupid) == 6 then
Player.Team = game.Teams["L.I.M.B.O"]


elseif Player:GetRankInGroup(groupid) == 5 then
Player.Team = game.Teams["L.I.M.B.O"]


elseif Player:GetRankInGroup(groupid) == 4 then
Player.Team = game.Teams["L.I.M.B.O"]


elseif Player:GetRankInGroup(groupid) == 3 then
Player.Team = game.Teams["L.I.M.B.O"]


elseif Player:GetRankInGroup(groupid) == 2 then
Player.Team = game.Teams["L.I.M.B.O"]


elseif Player:GetRankInGroup(groupid) == 1 then
Player.Team = game.Teams["L.I.M.B.O"]


elseif not Player:IsInGroup(groupid) then
    Player.Team = game.Teams["The Impure"]
end
end)
2 Likes

thank you so much! i will test it and come back should the script be in workspace?

The script would be in Server Script Storage.

1 Like