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

How do I do so that if someone is not in the group he spawns as a visitor team?

How do I do so that if someone is not in the group he spawns as the team Visitors

groupID = 00000 -- The group ID
teamColor = "High Ranks" -- The team color

game.Players.PlayerAdded:connect(function(player)
if (player:IsInGroup(groupID)) then
player.TeamColor = BrickColor.new(teamColor)
end
end)

1 answer

"High Ranks" isn't a BrickColor, it's a team name, so try setting the Team property instead.

local groupId = 123
local groupTeam = game:GetService("Teams")["High Ranks"]

game:GetService("Players").PlayerAdded:Connect(function(plr)
	if plr:IsInGroup(groupId) then
		plr.Team = groupTeam
	end
end)

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