Hi there, I am trying to get all children parts named "Straight" and all named "Turn" and set the collisions of them.
This is what I tried but its not working
*Note that "Part" is a detector used to trigger the script and the model folder for the parts im wanting to change the collision script is the parent of "Part", eg. Part.Parent
Hope that makes sense :)
local prts = Part.Parent:GetChildren()
for i = 1, #prts do
if prts.Name == "Straight" then
prts[i].Transparency = 1
prts[i].CanCollide = false
elseif prts.Name == "Turn" then
prts[i].Transparency = 0
prts[i].CanCollide = true

3 comments
This isn't working because you're checking the table's name (prts.Name). Tables do not have a name property. Instead, you should do prts[i].Name.
ah thanks ill give that a go
change 'if prts.Name' to 'if parts[i].Name