Ksenophon
|
  |
| Joined: 08 Apr 2017 |
| Total Posts: 162 |
|
|
| 12 Oct 2017 03:33 PM |
function Enter(newPlayer) if newPlayer:IsInGroup(3517614) then newPlayer.TeamColor=script.Parent.TeamColor end end
game.Players.ChildAdded:connect(Enter)
how do I make it where, it teams the person that is in the group that team color, then respawns them?
help will be appreciated |
|
|
| Report Abuse |
|
|
RXTE95
|
  |
| Joined: 29 Jun 2017 |
| Total Posts: 169 |
|
|
| 12 Oct 2017 04:10 PM |
| there's an easier way to assign players to teams, this feature is actually in studio ready to go. if I understand you right, you want players to be automatically assigned to teams. in this case you would just add a leaderboard and then add teams under services and then add your spawns and set team colors and when someone joins it will automatically assign them to a team. there is other options in this such as switching teams etc. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 12 Oct 2017 04:15 PM |
That's not even close to what he asked.. 😕
First, OP, you need to turn off CharacterAutoLoads. It's a property of the Players service.
Then, put this script in a server script inside the ServerScriptService
game.Players.PlayerAdded:connect(function(player)
if player:IsInGroup(3517614) then player.Team = game.Teams["The Cool Kids"] -- or whatever your team name is else player.Team = game.Teams.Visitors end
player.CharacterAdded:connect(function(char) print("their character was loaded after their team was set") end)
player:LoadCharacter() end) |
|
|
| Report Abuse |
|
|
iiNemo
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 2380 |
|
|
| 12 Oct 2017 04:23 PM |
| local PS = game:GetService('Players') local TS = game:GetService('Teams') local GroupTeam = 'Nemo' local NonGroupTeam = 'Visitors PS.PlayerAdded:Connect(function(Player) if not ######################### #### ########### = TS[GroupTeam] else Player.Team = TS[NonGroupTeam] end Player:LoadCharacter() end) -- Considering if you even made 2 teams.. |
|
|
| Report Abuse |
|
|
RXTE95
|
  |
| Joined: 29 Jun 2017 |
| Total Posts: 169 |
|
|
| 13 Oct 2017 10:32 PM |
| Oh ok I see what he means now. |
|
|
| Report Abuse |
|
|