I need help making a Auto Team Script for a military group, I am helping to make, I have tried a lot of different scripts but I can’t get any to work.
I need the script to work with multiple groups, so if someone is in a group they will go to the team with the same name as the group.
I have followed a tutorial and got this but it won’t work
game.Players.PlayerAdded:connect(function(player)
if
player:IsInGroup(13608814) and player:GetRankInGroup(13608814) >= 255 then
player.TeamColor = game.Teams["Headquarters"].TeamColor
player:LoadCharacter()
elseif player:IsInGroup(13608814) andplayer:GetRankInGroup(13608814) >= 254 then
player.TeamColor = game.Teams["Headquarters"].TeamColor
player:LoadCharacter()
elseif player:IsInGroup(13608814) and player:GetRankInGroup(13608814) >= 23 then
player.TeamColor = game.Teams["Headquarters"].TeamColor
player:LoadCharacter()
elseif player:IsInGroup(13608814) and player:GetRankInGroup(13608814) >= 22 then
player.TeamColor = game.Teams["Headquarters "].TeamColor
player:LoadCharacter()
elseif player:IsInGroup(13608814) and player:GetRankInGroup(13608814) >= 21 then
player.TeamColor = game.Teams["Headquarters"].TeamColor
player:LoadCharacter()
elseif player:IsInGroup(13608814) and player:GetRankInGroup(13608814) >= 20 then
player.TeamColor = game.Teams["Headquarters"].TeamColor
player:LoadCharacter()
player:LoadCharacter()
elseif
player:IsInGroup(GROUP ID) and player:GetRankInGroup(GROUP ID) >= 2 then
player.TeamColor = game.Teams["TEAM NAME"].TeamColor
player:LoadCharacter()
elseif player:IsInGroup(GROUP ID) and player:GetRankInGroup(GROUP ID) >= 1 then
player.TeamColor = game.Teams["TEAM NAME"].TeamColor
player:LoadCharacter()
elseif player:IsInGroup(GROUP ID) and player:GetRankInGroup(GROUP ID) >= 1 then
player.TeamColor = game.Teams["TEAM NAME"].TeamColor
player:LoadCharacter()
else return
end
end
If anyone can help or knows how to make this work please reply.