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

How can I change the name and color of a team with a script?

My script duplicates the default team and edits some properties, this works in the explorer, however, in game it shows that there is another white team called default.

here is my script:

local input = script.Parent
local button = input.Parent
local place = button.Parent.ScrollingFrame
local team = place.TextButton
local default = game.Teams.Default

button.MouseButton1Up:Connect(function()
	local addedteam = team:Clone()
	addedteam.Visible = true
	addedteam.Text = input.Text
	addedteam.Parent = place
	local teamteam = default:Clone()
	teamteam.Parent = game.Teams
	teamteam.Name = input.Text
	teamteam.TeamColor = BrickColor.new("Bright bluish green")
end)

2 comments

0

Did you do all this in a local script? If so that might be the problem

0

Also is there any errors in the output?

1 answer

First I would start off saying that I did not make this script, ScriptLocalize did.

I recommend using this script as it works and is great to learn off of.

Link to the script: https://devforum.roblox.com/t/how-change-player-team-color-and-name

Make a script in ServerScriptService then insert this script inside the script:

local function guestTeamJoin(player)

	local guestTeam = Instance.new("Team")
	guestTeam.Parent = game:GetService("Teams")

	guestTeam.Name = "Guest"

	guestTeam.AutoAssignable = true
	guestTeam.TeamColor = BrickColor.new("Really red")

	player.Team = guestTeam

	local guestSpawnLocation = Instance.new("SpawnLocation")
	guestSpawnLocation.Parent = workspace
	guestSpawnLocation.Parent = game:GetService("Teams")

	guestSpawnLocation.BrickColor = BrickColor.new("Really red")
	guestSpawnLocation.Neutral = true
	guestSpawnLocation.TeamColor = BrickColor.new("Really red")
end

game.Players.PlayerAdded:Connect(guestTeamJoin)

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