Custom team character

So, i am making a fighting game (it is very, very, VERY bad) and i wanna make custom team characters when you join, you character become something like, blue for blue team and red for red team or make a character select. And remember i am a new developer, dont hate me :frowning:

I don’t understand what you are trying to do. Are you trying to create a team to divide players into groups? Sorry, I just don’t 100% understand your question.

edit: oh wait, nevermind, I get it now.

A team is a api service that allows the player to get into certain teams. With teams, you can do a lot, especially with a team based game.

Here is how you create a team.

local Teams = game:GetService("Teams") -- this is an api service. The documentation will be linked below

local RedTeam = Instance.new("Team") -- This is an Instance
RedTeam.TeamColor = BrickColor.new("Bright Red") -- This is a property of the instance.

Documentation: Team | Documentation - Roblox Creator Hub

To change how a character looks you can use these functions:

You can set LoadCharacterAppearance in StarterPlayer to false. Then just change players’ colors/add accessories with something like this:

game.Players.PlayerAdded:connect(function(Player)
	`Player.CharacterAdded:connect`(function(Character)
		if Player.TeamColor == BrickColor.new("Bright green") then
			--Do stuff
		elseif Player.TeamColor == BrickColor.new("Bright red") then
			--Do stuff
	end)
end)
2 Likes

well, i dont want to create teams, i want to make something like a custom character to every team

For this situation I would recommend turning off auto respawn and make your code respawn the players. Use the Player:LoadCharacerWithHumanoidDescription to load/spawn the characters. If you change how the characters look after they spawn it uses extra resources and may look bad.

Connect each players death event to [wait time (or another pause) then use the player:loadcharacterwithhumanoiddescription() to respawn them]

Then, you will need to take advantage of StarterPlayerScripts, create a custom character with all the regular character joints, then simply name it “CustomCharacter”.

@PseudoPerson i wanna make something like, team blue have a character and team red have another character, not just change player character

ik. Connect a character needing to respawn to an if statement checking their team. Then respawn them with a character description based on the if statement.
Edit: Remember to turn off auto respawn for this though. Your script should handle respawns with the load character with humanoid description function.

so, idk how to script, i only know how to print ;-;. Can you show me in a video?

I can code it for you one second. There probably isn’t a video for something so specific.

ok, i will wait for the script

Here:

--//Services//--
local Players = game:GetService("Players")

Players.CharacterAutoLoads = false -- Change this on explorer too

--//Instance Variables//--

local fakeDescription = Instance.new("HumanoidDescription")
fakeDescription.HeadColor = BrickColor.new("Really blue").Color

local Descriptions = {
	[BrickColor.new("Really blue").Number] = fakeDescription;--Instance.new("HumanoidDescription"); -- Set the brick color to your first team. Sent the second value to the humanoid description. You can put this in ServerStorage or somewhere instead of building inside the script like I did.
	[BrickColor.new("Really red").Number] = Instance.new("HumanoidDescription"); -- Set the brick color to your first team. Sent the second value to the humanoid description. You can put this in ServerStorage or somewhere instead of building inside the script like I did.
}

local Teams = game:GetService("Teams")
local fakeTeam = Instance.new("Team", Teams)
fakeTeam.TeamColor = BrickColor.new("Really blue")

local function OnPlayerAdded(player)
	--Set team color here or add a wait() below to change it somewhere else before this runs. Or add a default team based on the neutral team color.
	
	player.CharacterAdded:Connect(function(character)
		local humanoid = character:WaitForChild("Humanoid")
		humanoid.Died:Connect(function()
			wait(5)
			local teamColor = player.TeamColor
			player:LoadCharacterWithHumanoidDescription(Descriptions[teamColor.Number])
		end)
	end)
	player:LoadCharacterWithHumanoidDescription(Descriptions[player.TeamColor.Number])
end


Players.PlayerAdded:Connect(OnPlayerAdded)

Sorry, I had to do something else. I didn’t know you were waiting.

1 Like

so, i put it in workspace and, camera was locked on a certain part of the map and another team was added…

put what in workspace? This code goes into a script in ServerScriptService

I used* to have a tutorial that covers this which includes setting it up and explaining how everything works in different sections of the video if you’re still looking for one in a video format.

Since I wasn’t satisfied with that tutorial, I’ve since taken it down but will reconsider making a new one in the future.


*Edit (February 9th, 2023)

Instead, I’d recommend watching this video about Custom Characters from GnomeCode (keep in mind that this doesn’t include the Team-only element of it): CUSTOM CHARACTERS - How to create, rig and animate - YouTube

oh, thx… wait, YOU ARE A 2K SUBSCRIBERS YOUTUBER

3 Likes