Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you change this value from Color to Material?

Asked by 9 years ago

Here. I tried editing the values... Heres the script

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

Heres the script with the one i tried editing and failed at it.

wait(1)
for i,v in pairs(script.Parent.Buttons:GetChildren()) do
    if v:FindFirstChild("ClickDetector") then
        v.ClickDetector.MouseClick:connect(function()
            script.Parent.Material.BrickMaterial = v.BrickMaterial
            script.Parent.Parent.Parent.DropMaterial.Value = v.BrickMaterial
        end)
    end
end

1 answer

Log in to vote
2
Answered by
LostPast 253 Moderation Voter
9 years ago

For material it is just Material. So use:

wait(1)
for i,v in pairs(script.Parent.Buttons:GetChildren()) do
    if v:FindFirstChild("ClickDetector") then
        v.ClickDetector.MouseClick:connect(function()
            script.Parent.Material.Material = v.Material
            script.Parent.Parent.Parent.Material.Value = v.Material
        end)
    end
end
Ad

Answer this question