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

Array not finding bricks, no errors?

my array seems to not be finding the names of the bricks i have it set up as shown below

http://prnt.sc/es3xfy

the is set up as shown below

local inv = {inv1, inv2, inv3, inv4 }
inv.Transparency = 1

1 comment

0

should i set the array variables equal to the names of the bricks in the outer wall group like this: inv.inv1=game.workspace["outer walls"].inv1 ?

1 answer

✓ Accepted answer

You have to loop through the table and set the transparency of each item in the array.

for _, obj in pairs(inv) do
	obj.Transparency = 1
end

Note: You should use the GetChildren() method to get a table of children from any instance or service.

local parts = workspace["outer walls"]:GetChildren()

for _, obj in pairs(parts) do
	obj.Transparency = 1
end

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