I am attempting to make a gui which when pressed, paints the car sitting on the Detector pad. It works fine just painting normal parts, but when it tries to paint the WedgeParts it brings this error:
BrickColor is not a valid member of Weld
here is the code:
--paints the car
-- wow
local detectorpad = script.Parent.Parent.Parent.Parent.Parent.Pad
detectorpad.Touched:Connect(function(part)
script.Parent.MouseButton1Click:Connect(function()
if part.Name == "Wheel" then
local car = part.Parent
local descendants = car.BodyPanels:GetDescendants()
for index, descendant in pairs(descendants) do
if descendant:IsA("Part") or ("WedgePart") then
descendant.BrickColor = BrickColor.new("White")
print "wee"
end
end
script.Parent.Parent.Parent.Parent.button:Play()
end
end)
end)

1 comment
you could also do if descendant:IsA("Part") or descendant:IsA("WedgePart") then