Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
YxTio 5
5 years ago

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

Log in to vote
0
Answered by 5 years ago

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.

Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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)
0
this wont work for me for some reason. please help darealfluffy26345 0 — 2y

Answer this question