Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Teams assigned by group ranks?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago
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!

0
ok I did that and it still didnt work. I typed it like this- sammy52520 45 — 9y
0
game.Players.PlayerAdded:connect(function(newPlayer) local rank=newPlayer:GetRankInGroup(2711838) if rank ==255 then newPlayer.TeamColor = BrickColor.new("black") end sammy52520 45 — 9y
0
'black' is not a valid color. 'Black' is. Capitals matter in lua coding. Thundermaker300 554 — 9y
0
Also would the local script be in Workspace or teams? sammy52520 45 — 9y
View all comments (2 more)
0
Erm it would be a script in workspace.. Thundermaker300 554 — 9y
0
Oh ok sammy52520 45 — 9y
Ad

Answer this question