What do you want to achieve? I want to make it so when a special part got touched it will do a thing/print
What is the issue? How would I make so if only the other part got touched by a special part it will print
What solutions have you tried so far? I tried to get the local part and then put it in
Example
local part = script.Parent
local part2 = game.Workspace.Part234234
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(part2) then
print("Touched")
end
end)
You sure the path is correct? From what I understand you’re finding if the 1st part is the parent of the second, but on the part2 variable you state that it’s parented to the workspace.
I got the local part I think it is a correctly way. I’m trying to do so if part got touched by a special part it will print and if part will touch not special part it will not print
You could put this in a ServerScript inside the part you want touched:
local trigger = script.Parent
local part2 = --your part here!!
trigger.Touched:Connect(function(hit))
if hit.Name == part2 or hit == part2 then
print("Special part touched!")
end
end)