How to make a StarterCharacter for different teams?

I’m creating a fighting game, one based around Orcs V.S. Humans.

I want to make a script that sets the player’s morph depending on what team they’re on. I’m using Teamservice if that helps.

1 Like

You can do it by checking the team color

if plr.TeamColor == BrickColor.new("Really red") then
3 Likes
local Game = game
local Players = Game:GetService("Players")
local Teams = Game:GetService("Teams")
local ServerStorage = Game:GetService("ServerStorage")
local RedTeam = Teams.RedTeam --Red team.
local BlueTeam = Teams.BlueTeam --Blue team.
local RedCharacter = ServerStorage.RedCharacter --Character model for red team.
local BlueCharacter = ServerStorage.BlueCharacter --Character model for blue team.

local function OnPlayerAdded(Player)
	local function OnCharacterAdded(Character)
		if Player.Team == RedTeam then
			Player.Character = RedCharacter --Override character with team's custom character.
		elseif Player.Team == BlueTeam then
			Player.Character = BlueCharacter --Override character with team's custom character.
		else
			--Could give players a default 'Neutral' custom character here.
		end
	end
	
	Player.CharacterAdded:Connect(OnCharacterAdded)
end

Players.PlayerAdded:Connect(OnPlayerAdded)

Something like this should work, you may need to add an explicit delay between characters being loaded/added and replaced/substituted for a custom character.

8 Likes