Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by 8 years ago
local Parts
script.Parent:GetConnectedParts(Parts)
Parts.BrickColor = BrickColor.Blue()

I Do Not Understand Why

0
What are you trying to do? Get all Parts that are connected to script.Parent and make their color blue? LetThereBeCode 360 — 8y
0
Yep exactly SamTheDeveloper 85 — 8y
0
this is a terrible code section. cant tell us anything lukeb50 631 — 8y
0
That is not a section its the full code SamTheDeveloper 85 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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
Ad

Answer this question