So I'm trying to change the skin color of the person and instead of having a bunch of code I decided to create an Instance IntValue that changes when the user clicks a different skin Icon and that calls a Changed:Connect function to change the players skin color.
So I'm Getting this error: 13:53:54.841-Players.SoSurfsUpSeth.PlayerGui.StartMenu.CreateCharacter.CreateCharacter:13: attempt to index upvalue 'SkinColorNotifier' (a number value)
Here is this code:
local player = game.Players.LocalPlayer local Character = player.Character local SkinColorList = player.PlayerGui.StartMenu.CreateCharacter.SkinColor.SkinColor.SkinColorList local SkinColorSelected = Color3.new(SkinColorList.White.BackgroundColor3) local SkinColorNotifier = Instance.new("IntValue") SkinColorNotifier.Changed:Connect(function(player) Character.Head.BrickColor = BrickColor.new(SkinColorSelected) end) -- Skin Color Selection local function White() SkinColorSelected = SkinColorList.White.BackgroundColor3 SkinColorNotifier.Value = 1 end local function WhiteTan() SkinColorSelected = SkinColorList.WhiteTan.BackgroundColor3 SkinColorNotifier.Value = 2 end local function Tan() SkinColorSelected = SkinColorList.Tan.BackgroundColor3 SkinColorNotifier.Value = 3 end local function PinkTan() SkinColorSelected = SkinColorList.PinkTan.BackgroundColor3 SkinColorNotifier.Value = 4 end local function DarkPinkTan() SkinColorSelected = SkinColorList.DarkPinkTan.BackgroundColor3 SkinColorNotifier = 5 end local function OrangeTan() SkinColorSelected = SkinColorList.OrangeTan.BackgroundColor3 SkinColorNotifier = 6 end local function LightBrown() SkinColorSelected = SkinColorList.LightBrown.BackgroundColor3 SkinColorNotifier = 7 end local function Brown() SkinColorSelected = SkinColorList.Brown.BackgroundColor3 SkinColorNotifier = 8 end SkinColorList.White.MouseButton1Click:Connect(White) SkinColorList.White.MouseButton1Click:Connect(WhiteTan) SkinColorList.White.MouseButton1Click:Connect(Tan) SkinColorList.White.MouseButton1Click:Connect(PinkTan) SkinColorList.White.MouseButton1Click:Connect(DarkPinkTan) SkinColorList.White.MouseButton1Click:Connect(OrangeTan) SkinColorList.White.MouseButton1Click:Connect(LightBrown) SkinColorList.White.MouseButton1Click:Connect(Brown)