What do you want to achieve?
I want a function to trigger anytime the player touches a part but it also triggers if the player touches another part with the same name
What is the issue?
it only triggers if I touch one of the parts
What solutions have you tried so far?
I tried to use findfirstchild but it still only works for one part
Im doing this because I basically want people to use an attack so I just dupe it, and the code is already like 400 lines so I want to keep it short. the part has 6 hitboxes, but I can just use the model’s name (I think).
You can write the function(not as an anonymous function) and then connect it to all the parts you want. Use a for loop to check for every part with the same name.
local function onTouchTrigger(touched)
-- your function here
end
for _, instance in Model:GetChildren() do
if part.Name == "triggerBrickOrSomething" then
part.Touched:Connect(onTouchTrigger)
end
end
The more fancier alternative is to use CollectionService.