So, i made a code this summer and it did not work. I am very curious why, because i have literally no idea what was wrong there. I have got the entire script here, but i already rewritten the script in game and it works but i am probably not going to be able to give more context, hovewer ask if necessary maybe i will find something. The problem is inside this code, because i only changed this script and it started working. It didnt even give errors, just didnt work.
local colorh = game.ReplicatedStorage.ColorHair.Value
local colors = game.ReplicatedStorage.ColorShirt.Value
local colorp = game.ReplicatedStorage.ColorPants.Value
game.ReplicatedStorage.Events.SetColors.OnServerEvent:Connect(function(plr)
local hair = plr.Character.Head.Hair.Hair
local pants = plr.Character.Pants
local shirt = plr.Character.Shirt
if colorh == 1 then
hair.BrickColor = BrickColor.new("Institutional white")
elseif colorh == 2 then
hair.BrickColor = BrickColor.new("Really black")
elseif colorh == 3 then
hair.BrickColor = BrickColor.new("Sand green")
elseif colorh == 4 then
hair.BrickColor = BrickColor.new("New Yeller")
elseif colorh == 5 then
hair.BrickColor = BrickColor.new("Persimmon")
elseif colorh == 6 then
hair.BrickColor = BrickColor.new("Electric blue")
elseif colorh == 7 then
hair.BrickColor = BrickColor.new("Bright green")
elseif colorh == 8 then
hair.BrickColor = BrickColor.new("Alder")
elseif colorh == 9 then
hair.BrickColor = BrickColor.new("Flame yellowish orange")
elseif colorh == 10 then
hair.BrickColor = BrickColor.new("Teal")
end
if colorp == 1 then
pants.Color3 = Color3.fromRGB(255,255,255)
elseif colorp == 2 then
pants.Color3 = Color3.fromRGB(0,0,0)
elseif colorp == 3 then
pants.Color3 = Color3.fromRGB(125,125,125)
elseif colorp == 4 then
pants.Color3 = Color3.fromRGB(255,255,0)
elseif colorp == 5 then
pants.Color3 = Color3.fromRGB(255,80,80)
elseif colorp == 6 then
pants.Color3 = Color3.fromRGB(50,120,255)
elseif colorp == 7 then
pants.Color3 = Color3.fromRGB(80,200,100)
elseif colorp == 8 then
pants.Color3 = Color3.fromRGB(180,40,255)
elseif colorp == 9 then
pants.Color3 = Color3.fromRGB(250,160,50)
elseif colorp == 10 then
pants.Color3 = Color3.fromRGB(90,255,200)
end
if colors == 1 then
shirt.Color3 = Color3.fromRGB(255,255,255)
elseif colors == 2 then
shirt.Color3 = Color3.fromRGB(0,0,0)
elseif colors == 3 then
shirt.Color3 = Color3.fromRGB(125,125,125)
elseif colors == 4 then
shirt.Color3 = Color3.fromRGB(255,255,0)
elseif colors == 5 then
shirt.Color3 = Color3.fromRGB(255,80,80)
elseif colors == 6 then
shirt.Color3 = Color3.fromRGB(50,120,255)
elseif colors == 7 then
shirt.Color3 = Color3.fromRGB(80,200,100)
elseif colors == 8 then
shirt.Color3 = Color3.fromRGB(180,40,255)
elseif colors == 9 then
shirt.Color3 = Color3.fromRGB(250,160,50)
elseif colors == 10 then
shirt.Color3 = Color3.fromRGB(90,255,200)
end
end)