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

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

Asked by
Jo_Bot 67
6 years ago
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 Scriptin the Frameof the gui

0
mousebutton1click cannot be used in an if statement greatneil80 2647 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

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

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

For each of the buttons.

0
Thankyou! This worked! Jo_Bot 67 — 6y
1
and then you can remove the while loop. you really should, by commenting out line 5, 59 and 60 Nonaz_jr 439 — 6y
0
^ BouncingBrenda 44 — 6y
Ad

Answer this question