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

How do i change the avatar's skin tone when someone spawns in my game?

im completely clueless about how to change someones avatar skin tone when they join the game. idk what code i should use. can someone help

2 answers

You would have to make a script that not only changes the skin tone on player joined, but also on player respawn. Such as a PlayerAdded:Connect() function. You can then use that function to access the Body Colors in the players character model and change it via the script.

Characters spawn with a BodyColors object, which you can use to change the skin colours. Unfortunately you need to do this line-by-line:

local colour = Color3.fromRGB() -- fill this RGB value in
local bodyColours = character:WaitForChild("BodyColors")
bodyColours.HeadColor3 = colour
bodyColours.LeftArmColor3 = colour
bodyColours.RightArmColor3 = colour
bodyColours.LeftLegColor3 = colour
bodyColours.RightLegColor3 = colour
bodyColours.TorsoColor3 = colour

Then you can bind this to the Player.CharacterAdded event so it fires when the player spawns.

local player = game.Players.LocalPlayer -- remember to do this in a LocalScript!
colour = Color3.fromRGB() -- fill in

player.CharacterAdded:Connect(function()
	local bodyColours = character:WaitForChild("BodyColors")
	bodyColours.HeadColor3 = colour
	bodyColours.LeftArmColor3 = colour
	bodyColours.RightArmColor3 = colour
	bodyColours.LeftLegColor3 = colour
	bodyColours.RightLegColor3 = colour
	bodyColours.TorsoColor3 = colour
end)

1 comment

0

this wont work for me for some reason. please help

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