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

Need Help Completing My System?

Okay so ignore the title, This question has come from the top of my head... How could i grab and edit these parts all at the same time? With a variable containing all the parts... Could i even do this?

local p = {game.workspace.NAMEDPART,game.workspace.NAMEDPART

Or would i do

local k = {game.workspace.NAMEDPART/game.workspace.OTHERNAMEDPART}

IM RIDICULOUSLY NEW TO THIS and i want to know how to get access to the named parts with a Variable... Or an easier way.

Remember, This just came from the top of my head. Am i Confused and wanting to know more ways i could do this.

STILL CONFUSED? I guess what im saying is how could i get accessed to these parts... I do not understand Get Decendants and i want to.

1 answer

✓ Accepted answer
local PartsYouWantToEdit = {game.Workspace.YourPart1,game.Workspace.YourPart2}

for _, Part in pairs(PartsYouWantToEdit) do
	-- Do whatever you want here
	-- For example, I will edit the color
	Part.BrickColor = BrickColor.new("Really red")
end

1 comment

0

Sounds Intersting... Could you explain why you'd use _, and if you say in pairs... Could it find ANYTHING or just in workspace... Maybe if you remove the thing around? Please Explain

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