So I have a very simple question but for some reason I am having a hard time on it. I was using this script to change the Drop color of the Drop based on the BrickColorValue. Then I made a model with buttons that when you click it, it changes the BrickColorValue's Value to the color of the Button.
wait(1)
for i,v in pairs(script.Parent.Buttons:GetChildren()) do
if v:FindFirstChild("ClickDetector") then
v.ClickDetector.MouseClick:connect(function()
script.Parent.Color.BrickColor = v.BrickColor
script.Parent.Parent.Parent.DropColor.Value = v.BrickColor
end)
end
end
That works fine and dandy. I then wanted to add the same sorta thing, but to change the Material. I used a String Value for this but when you click on the button it doesn't change the Material at all this is the script I have so far.
wait(1)
for i,v in pairs(script.Parent.Buttons:GetChildren()) do
if v:FindFirstChild("ClickDetector") then
v.ClickDetector.MouseClick:connect(function()
script.Parent.Color.Material = v.Material
script.Parent.Parent.Parent.DropMaterial.Value = v.Material
end)
end
end
Can you please help me figure out the problem?
