So I've made this
function onPlayerEntered(plyr) if plyr:IsInGroup(5233740)>=10 then plyr.TeamColor = BrickColor.new("Bright yellow") elseif plyr:IsInGroup(5244884) then plyr.TeamColor = BrickColor.new("Navy blue") elseif plyr:IsInGroup(5235212) then plyr.TeamColor = BrickColor.new("Crimson") elseif plyr:IsInGroup(5246404) then plyr.TeamColor = BrickColor.new("Really black") elseif plyr:IsInGroup(5233740)<10 then plyr.TeamColor = BrickColor.new("Cyan") end end game.Players.PlayerAdded:connect(onPlayerEntered)
But won't work, I have a main group and 3 divisions, so I want when someone joins IF he is a HR in the main group to be teamed Bright yellow, if not check if he is in any of the three divisions and lastly to be teamed in the main group; and I managed to make it work 'till I added the ranks' matter (<= etc.) next to the ID... Can anyone do this for me?
Hey Mqanos!
Try this script.You were only setting the team color :)
local teams = game:GetService("Teams") game.Players.PlayerAdded:Connect(function(plr) if plr:IsInGroup(5233740) then if plr:GetRankInGroup(5233740) >= 10 then plr.Team = teams.Officers plr.TeamColor = teams.Officers.TeamColor else if plr:GetRankInGroup(5233740) >= 17 then plr.Team = teams.Headquarters plr.TeamColor = teams.Headquarters.TeamColor else plr.Team = teams.Enlisted plr.TeamColor = teams.Enlisted.TeamColor end end end if plr:IsInGroup(5244884) then plr.Team = teams["Div 1"] plr.TeamColor = teams["Div 1"].TeamColor end if plr:IsInGroup(5235212) then plr.Team = teams["Div 2"] plr.TeamColor = teams["Div 2"].TeamColor end if plr:IsInGroup(5246404) then plr.Team = teams["Div 3"] plr.TeamColor = teams["Div 3"].TeamColor end end)