Hi, I'm implementing a system where you can customize the colour of your gun. The RecolourValue is a BrickColorValue. It prints "1" and also prints "2", but does not print "3".
PrimaryMaterial = "Wood"
for i,v in pairs(script.Parent:GetChildren()) do
print '1'
if v.ClassName == "Part" or v.ClassName == "WedgePart" then
print '2'
if v.Material == (PrimaryMaterial) then
print '3'
v.BrickColor = BrickColor.new(script.Parent.Parent.Parent.shopandinventoryvalues.RecolourValue.Value)
end
end
end
Thanks for your help!

3 comments
Because you're comparing Material to a string rather than the material itself. Change (PrimaryMaterial) to Enum.Material.Wood
^ you beat me by 4 mins gg
oh dang okay, thanks ill try this when i get home