I'm trying to make a certain brick to pass through a wall. I want to let a certain brick called "x" to pass through the wall "y". If the wall detects another brick, whose name is not "x", then it will delete it.
function lala()
if
game.Workspace.Name.x -- I have no idea what to do around here
then
print("x confirmed")
else
local part = game.Workspace.Part -- This one too
part:Destroy()
print("Removing this junk.")
end
end
script.Parent.Parent.y.Touched:connect(lala)
Now, the problem is that the wall will immediately execute the Else code, whenever the "x" block passes through. It will delete ANY random brick that has the name "Part".
So my questions are:
- How do I let "x" pass through the wall "y", without the else code will be executed?
- How do I let the wall "y" delete the brick that passes through?

1 comment
Aah, most excellent. After editing your script a bit, it worked. It didn't not solved my second problem though, but I fixed it by implementing (part.Parent = nil) below the Else, in case someone else had this similar problem too.