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

Changing default character appearance?

So I wrote this script which changes the character appearance in game. The only problem is that it will only work when I reset. Before I reset, the clothes are already here but not the skin colors and face. Also, the my hats aren't removed until I reset. So basically I need it to so once I enter the game, it automatically changes my appearance without me having to reset.

game.Workspace.ChildAdded:connect(function(plr)
local name = plr.Name
local playerinplayers = game.Players:FindFirstChild(plr.Name)
if playerinplayers ~= nil then
playerinplayers.CanLoadCharacterAppearance = false
plr.Head.face.Texture = "rbxassetid://64064193"
local bodycolors = Instance.new("BodyColors", plr)
bodycolors.RightArmColor = BrickColor.new("Cashmere")
bodycolors.LeftArmColor = BrickColor.new("Cashmere")
bodycolors.LeftLegColor = BrickColor.new("Cashmere")
bodycolors.RightLegColor = BrickColor.new("Cashmere")
bodycolors.TorsoColor = BrickColor.new("Cashmere")
bodycolors.HeadColor = BrickColor.new("Cashmere")
local shirt = Instance.new('Shirt',plr)shirt.ShirtTemplate = "rbxassetid://276318635"
local pants = Instance.new('Pants',plr)pants.PantsTemplate = "rbxassetid://276318699"
end
end)

2 answers

✓ Accepted answer
game.Players.PlayerAdded:connect(function(Player)
	Player.CharacterAdded:connect(function()
		Player.CharacterAppearanceLoaded:connect(function()
			local Character = Player.Character
			local Head = Character.Head
			local BodyColors = Character:FindFirstChild("Body Colors")
			local Shirt = Character:FindFirstChild("Shirt")
			local Pants = Character:FindFirstChild("Pants")
			if Shirt then
				Shirt.ShirtTemplate = "rbxassetid://276318635"
			else
				local Shirt = Instance.new("Shirt", Character)
				Shirt.ShirtTemplate = "rbxassetid://276318635"
			end
			if Pants then
				Pants.PantsTemplate = "rbxassetid://276318699"
			else
				local Pants = Instance.new("Pants", Character)
				Pants.PantsTemplate = "rbxassetid://276318699"
			end
			for i, v in pairs(Character:GetChildren()) do 
				if v.ClassName == "Hat" then v:remove()
				else
				end
			end
			Head.face.Texture = "rbxassetid://64064193"
			BodyColors.RightArmColor = BrickColor.new("Cashmere")
			BodyColors.LeftArmColor = BrickColor.new("Cashmere")
			BodyColors.LeftLegColor = BrickColor.new("Cashmere")
			BodyColors.RightLegColor = BrickColor.new("Cashmere")
			BodyColors.TorsoColor = BrickColor.new("Cashmere")
			BodyColors.HeadColor = BrickColor.new("Cashmere")
		end)
	end)
end)

This runs everytime something is added into workspace..try playeradded event instead

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