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

Is there a possible way to make function to a bunch of bricks with short coding?

I want to change the decal of the bricks in short possible way. How to do it?

1 answer

✓ Accepted answer

You are able to iterate through the descendants of a model to edit properties of the instances inside.

local model = --model directory here
for _,v in pairs(model:GetDescendants()) do
	if v:IsA("Decal") then
		v.Texture = "" --new texture here
	end
end

GetDescendants returns a table of all children inside of an instance (including children of children, and so on). You can iterate through this table, and check each instance in the table to see if it is a decal, and if it is, change its texture.

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