How would i be able to make a part collidable with certain parts, but not with others? (Without turning CanCollide to true and false over and over again)
COMMUNITY QUESTION
Make a part collidable with certain parts?
1 answer
You may get mad for this, but that's the way.
You can create a part that is originally collidable, and make ones with certain names stop.
Let's give an example.
local name1="ball"
local name2="duck"
function touch(hit)
if hit.Name~=name1 or name2 then
script.Parent.CanCollide=false
wait(.5)
script.Parent.CanCollide=true
else
ex=Instance.new("Explosion")
ex.Parent=game.Workspace
ex.Position=script.Parent.Position
end
end
Script.Parent.Touched:connect(touch)
This will let any part without the name duck or ball through. If not, BOOM!
Hope this helped!
-ds
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
This is a very good question that I'd like to know the answer to.