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

Make A Player Join A Team When They Join?

Hello there! How can I make a script where if the player joins the game it auto team him to a specific team.

Colour of the team: fossile team name: Outsiders

7 comments

0

im pretty sure you just have to do player.Team = TeamObject

0

so in your case it would be player.Team = game:GetService("Teams"):WaitForChild("Outsiders")

0

what about the team colour and the name how the script would know which team

0

nvm shoukd that be in serverscriptservices

0

oh, you could also just set both of the teams autoassignable to true and then itd be handled automatically

0

oh

0

thans it works

2 answers

Your code would be


game.Players.PlayerAdded:Connect(function(plr)
     plr.Team = game.Teams.Outsiders
     plr:LoadCharacter()
end)

But also this isn’t a request site

You can use this code:

game.Players.PlayerAdded:Connect(function(p)
	p.Team = game.Teams:WaitForChild("Outsiders")
end

For the future, this is to help people fix their code, not make the code.

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