I have tried
if hit.Parent ~= child --[[i have defined this value]] then
--code
end
I have tried
if hit.Parent ~= child --[[i have defined this value]] then
--code
end
Do it something like this:
Part.Touched:Connect(function(hit)
if Part.Parent == hit.Parent then
-- We are saying that if the part's parent is equal to the parent of the item that hitted the part.
end
end)
If you have any questions, I will definitely help.
If that doesn't work try 'if Part.Parent == hit.Parent.Parent then'
There are multiple ways to do this.
1:
if hit.Parent == Part.Parent then
-- code here
2:
if hit.Parent:FindFirstChild("Part") then
-- code here
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Please explain you question properly.
for example a part touches a part. how do i check if the 2 parts parents are the same?