Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to target bricks with a certain material?

I'm working on an if statement that if the descendants is a brick and its material is neon, it changes their color. I'm using IsA to do this, but I'm not familiar with it.

Could someone help me with how I should write it?

1 answer

✓ Accepted answer

this should work.

for i,v in pairs(workspace:GetDescendants()) do
      if v.Material == Enum.Material.Neon then
-- script
   end
end

  • also change color
for i,v in pairs(workspace:GetDescendants()) do
      if v.Material == Enum.Material.Neon then
           v.Color3 = Color3.fromRGB(255,0,0)
   end
end

2 comments

0

Thank you so much!

0

no problem :D

This discussion is preserved as it was. New answers, comments, and votes are closed.