Hello, So I am working on a game lately and I have run into a problem I’m trying to make it when the player clicks a button a list of colors show that I have put in a folder.
I got that to work all that happens is that when I click the button all it shows is a list of black buttons.
Here is my script.
local ColorFrame = script:WaitForChild(“Color”)
local ColorFolder = game.ReplicatedStorage:WaitForChild(“Colors”)
local StorageFrame = script.Parent.Parent.Parent.Parent.MapMaterials.MaterialList
script.Parent.MouseButton1Click:Connect(function()
StorageFrame.Parent.Visible = true
for i, Children in pairs(ColorFolder:GetChildren()) do
local Clone = ColorFrame:Clone()
Clone.Parent = StorageFrame
Clone.Name = Children.Name
local Vec3 = Children.Value
--local Color = Color3.fromRGB(Vec3.X, Vec3.Y, Vec3.Z)
Clone.BackgroundColor3 = Color3.fromRGB(Vec3)
Clone.MouseButton1Click:Connect(function()
wait(0.25)
for i, DeleteChildren in pairs(StorageFrame:GetChildren()) do
if DeleteChildren:IsA("TextButton") then
DeleteChildren:Destroy()
end
end
wait(0.05)
for i, Materials in pairs(workspace.MapGround:GetChildren()) do
if Materials.Name == "Ground" then
Materials.Color = Clone.BackgroundColor3
end
end
StorageFrame.Parent.Visible = false
script.Parent.Parent:WaitForChild("MapMaterialFrame").Image = Clone.Image
end)
end
end)
If you need anymore information just ask and I am happy to give it.