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

Why Don't My Parts That are Connected to script.Parent Turn Blue?

local Parts
script.Parent:GetConnectedParts(Parts)
Parts.BrickColor = BrickColor.Blue()

I Do Not Understand Why

4 comments

0

What are you trying to do? Get all Parts that are connected to script.Parent and make their color blue?

0

Yep exactly

0

this is a terrible code section. cant tell us anything

0

That is not a section its the full code

1 answer

✓ Accepted answer

Well, you aren't using any tables to store the actual parts. What GetConnectedParts does, it returns a table of all parts connected to the part on which you call that method on. What you should do is:

local Parts = script.Parent:GetConnectedParts()

for _,part in pairs(Parts) do
	if part ~= script.Parent then
		part.BrickColor = BrickColor.Blue()
	end
end

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