Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Teams assigned by group ranks?

So I am wanting to associate teams with group ranks but I can't seem to figure out how. I tried a conditional statement but it kept saying "then" was incorrect or there needed to be an '=' sign before "nePlayer:..."

Here is the most recent local script that I tried. If anyone can help it would be amazing.

Here it is-

game.Players.PlayerAdded:connect(function(newPlayer) local rank=newPlayer:GetRankInGroup(2711838) local teamName='Owner' if rank ==255 then teamName='Owner' end end)

1 answer

✓ Accepted answer
game.Players.PlayerAdded:connect(function(newPlayer)
 local rank=newPlayer:GetRankInGroup(2711838)
if rank ==255 then newPlayer.TeamColor = BrickColor.new("Bla") end --Change Bla to the color of the team, The color is the color of the team when it is created. (TeamColor property of a Team)
 end)

Hope this helped! If it did, please leave an upvote!

6 comments

0

ok I did that and it still didnt work. I typed it like this-

0

game.Players.PlayerAdded:connect(function(newPlayer) local rank=newPlayer:GetRankInGroup(2711838) if rank ==255 then newPlayer.TeamColor = BrickColor.new("black") end

0

'black' is not a valid color. 'Black' is. Capitals matter in lua coding.

0

Also would the local script be in Workspace or teams?

0

Erm it would be a script in workspace..

0

Oh ok

This discussion is preserved as it was. New answers, comments, and votes are closed.