Let me explain my question.We have Part A, B, and C. What I wanted to do is that Part B is non-CanCollide to Part A only while it can collide with Part C. I am new to scripting and I can't make up my own script.
You will need PhysicService for that
https://developer.roblox.com/en-us/api-reference/class/PhysicsService
What this does is basically allows you to create groups and set their rules
example :
local PartA = --Part A here local PartB = --Part B here local PartC = --Part C here local PhysicService = game:GetService("PhysicsService") --That will call the service that will provide us with the functions that we need PhysicService:CreateCollisionGroup("GroupA") PhysicService:CreateCollisionGroup("GroupB") PhysicService:CreateCollisionGroup("GroupC") --This will create collision group which we can put multiple objects in PhysicService:CollisionGroupSetCollideable("GroupA", "GroupB", false) --This will set a rule, any object that is set to "GroupA" cannot collide with "GroupB" PhysicService:CollisionGroupSetCollideable("GroupB", "GroupC", false) --This will set a rule, any object that is set to "GroupB" cannot collide with "GroupC" PhysicService:SetPartCollisionGroup(PartA, "GroupA") PhysicService:SetPartCollisionGroup(PartB, "GroupB") PhysicService:SetPartCollisionGroup(PartC, "GroupC") --This will set all the part into a collision group
-
--The end result of that script will be : --- PartA cannot collide with PartB, but can collide with PartC --- PartB cannot collide with PartC and PartA --- PartC cannot collide with PartB, but can collide with PartA --Hopefully that explanation is detailed and simple enough
game.Workspace.Part.Cancollid = true