I made a script where if a user changes the color of an imagelabel using a colorwheel gui and clicks a textbutton, it changes an accessory’s meshpart color to the imagecolor of an imagelabel.
the problem is that i cant get it to change the color based on the imagecolor. I cant further explain since english isnt my first language but heres the script:
local confirmbutton = script.Parent.Confirm
local colorclothes = game.ReplicatedStorage:WaitForChild("ColorClothes")
local finalcolor = script.Parent.Parent.Parent.ColourWheelGui.Frame.ColourDisplay
local character = game.Players.LocalPlayer.EquippedAccessories()
for i, v in pairs(character:GetChildren()) do if v:IsA("Accessory") then
end
local Accessory = character
for i, v in pairs(character:GetChildren()) do if v:IsA("MeshPart") then
end
colorclothes.OnServerEvent:Connect(function()
confirmbutton.MouseButton1Click:Connect(function()
Accessory.Color = finalcolor.BackgroundColor3
if you can help it would really mean alot
(excuse if i made a few grammar mistakes as english isnt my first language)
I’d put it in the connection to your button, like this:
confirmButton.MouseButton1Click:Connect(function()
for _,accessory in game.Players.LocalPlayer.Character.Humanoid:GetAccessories() do
accessory.Handle.Color = finalcolor.BackgroundColor3
end
end)
Make sure it’s replacing the loop which you originally used to get the accessories.
Your code structure is certainly… odd…
Anyway, you seem to only have copied half the code I sent you. Try copying and pasting the whole thing this time.
local confirmbutton = script.Parent.Confirm
local colorclothes = game.ReplicatedStorage:WaitForChild("ColorClothes")
local finalcolor = script.Parent.Parent.Parent.ColourWheelGui.Frame.ColourDisplay
local character = game.Players.LocalPlayer.EquippedAccessories()
for i, v in pairs(character:GetChildren()) do
if v:IsA("Accessory") then
local Accessory = character
for i, v in pairs(character:GetChildren()) do
if v:IsA("MeshPart") then
colorclothes.OnServerEvent:Connect(function()
confirmbutton.MouseButton1Click:Connect(function()
Accessory.Handle.TextureId = ""
Accessory.Handle.Color = finalcolor.BackgroundColor3
end)
end)
end
end
end
end
local confirmbutton = script.Parent.Confirm
local finalcolor = script.Parent.Parent.Parent.ColourWheelGui.Frame.ColourDisplay
confirmButton.MouseButton1Click:Connect(function()
for _,accessory in game.Players.LocalPlayer.Character.Humanoid:GetAccessories() do
accessory.Handle.Color = finalcolor.BackgroundColor3
end
end)
I don’t know what the colorclothes RemoteEvent was for so I’ve left it out.