My GetTouchingParts script suddenly doesnt work anymore, but I probably messed it up, so I made something in a new game, a part named test touches two other parts, named part. This is the code I used:
local test = game.Workspace.test for i,v in pairs(test:GetTouchingParts())do print(v.Name.." touched") end for i,v in pairs(test:GetConnectedParts())do print(v.Name.." connected") end
and this is the output I got:
test connected Part connected (x2)
Can anyone tell me what I did wrong here?
Edit1
local test = game.Workspace.test local PartsTouched = {} -- create a table for i,part in pairs(test:GetConnectedParts()) do if not part.Name == test.Name then table.insert(PartsTouched, part) -- add the part to our table end end for i,part in pairs(PartsTouched) do print(part.Name .. " connected.") -- print the table end
This should print every part connected but the test¨part itself.