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

Character customization not working(Eye color and Skin tone)?

plr = game.Players.LocalPlayer
chr = plr.Character
mouse = plr:GetMouse()

while true do
eye = script.Parent.EyeColor
skin = script.Parent.SkinTone
gender = script.Parent.Gender
hair = script.Parent.Hair
--eyecolor
if eye.Blue.MouseButton1Click == true then 
	chr.Head.LeftEye.Decal.Color3 = eye.Blue.BackgroundColor3
	chr.Head.RightEye.Decal.Color3 = eye.Blue.BackgroundColor3
end
if eye.Grey.MouseButton1Click == true then 
	chr.Head.LeftEye.Decal.Color3 = eye.Grey.BackgroundColor3
	chr.Head.RightEye.Decal.Color3 = eye.Grey.BackgroundColor3
end
if eye.Hazel.MouseButton1Click == true then 
	chr.Head.LeftEye.Decal.Color3 = eye.Hazel.BackgroundColor3
	chr.Head.RightEye.Decal.Color3 = eye.Hazel.BackgroundColor3
end
if eye.Green.MouseButton1Click == true then 
	chr.Head.LeftEye.Decal.Color3 = eye.Green.BackgroundColor3
	chr.Head.RightEye.Decal.Color3 = eye.Green.BackgroundColor3
end
if eye.Brown.MouseButton1Click == true then 
	chr.Head.LeftEye.Decal.Color3 = eye.Brown.BackgroundColor3
	chr.Head.RightEye.Decal.Color3 = eye.Brown.BackgroundColor3
end

--skintone
if skin.Lightest.MouseButton1Click == true then 
	chr.Head.Color = skin.Lightest.BackgroundColor3
	chr.LeftLowerArm.Color = skin.Lightest.BackgroundColor3
	chr.RightLowerArm.Color = skin.Lightest.BackgroundColor3
end
if skin.Light.MouseButton1Click == true then 
	chr.Head.Color = skin.Light.BackgroundColor3
	chr.LeftLowerArm.Color = skin.Light.BackgroundColor3
	chr.RightLowerArm.Color = skin.Light.BackgroundColor3
end
if skin.Middle.MouseButton1Click == true then 
	chr.Head.Color = skin.Middle.BackgroundColor3
	chr.LeftLowerArm.Color = skin.Middle.BackgroundColor3
	chr.RightLowerArm.Color = skin.Middle.BackgroundColor3
end
if skin.Dark.MouseButton1Click == true then 
	chr.Head.Color = skin.Dark.BackgroundColor3
	chr.LeftLowerArm.Color = skin.Dark.BackgroundColor3
	chr.RightLowerArm.Color = skin.Dark.BackgroundColor3
end
if skin.Darkest.MouseButton1Click == true then 
	chr.Head.Color = skin.Darkest.BackgroundColor3
	chr.LeftLowerArm.Color = skin.Darkest.BackgroundColor3
	chr.RightLowerArm.Color = skin.Darkest.BackgroundColor3
end

wait()
end

This script should allow me to change the eye color and skin tone of a custom character I created. I have 10 gui buttons, 5 for eye color and 5 for skin tone. It is not changing though, what should I do?

It is a Script in the Frame of the gui

1 comment

0

mousebutton1click cannot be used in an if statement

1 answer

✓ Accepted answer

Rather than "if skin.Dark.MouseButton1Click" you should do

eye.Blue.MouseButton1Click:connect(function()
  -do whatever
end)

For each of the buttons.

3 comments

0

Thankyou! This worked!

1

and then you can remove the while loop. you really should, by commenting out line 5, 59 and 60

0

^

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