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

Editing my script to first add a team?

I've made this script

function assignTeam(player, groupId, teamName) 
	if (player:IsInGroup(groupId) == true) then 
		local team = game:GetService("Teams") 
		if (team ~= nil) then 
			local team2 = team:FindFirstChild(teamName) 
			if (team2 ~= nil) then 
				if (player.Parent ~= nil) then 
					player.TeamColor = team2.TeamColor 
				end 
			end 
		end 
	end 
end 

game.Players.PlayerAdded:connect(function(p) 
	assignTeam(p, 2676831, "Croatians")

I wan't the script to first add the team "Croatians" and then put them into it, instead of just putting them in.

1 comment

0

"want" is not a contraction.

1 answer

If you want to create a new team, write Instance.new("Team"), set the Name and TeamColor, and parent it to Teams.

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