Hello. So if I have a simple touched script like so:
local part = script.parent
part.Touched:Connect(function(hit)
local char = hit.Parent:FindFirstChild("Humanoid")
if char ~= nil then
--do stuff
end
end)
What I'm trying to do is find the character no matter what the part touches. The "character" I'm looking for is a mob so I can't just check if it's in the players list.
So my question is how can I change this to always find the character that hit the part?

5 comments
You could change it's humanoid name to something besides humanoid, and find if the hit's humanoid name is what you changed it to.
welp, the hit is always one of the player's bodyparts, and always his feet, and the bodyparts are parented to the character, so simply: hit.Parent
or is that not waht you want?
Well the way I have the part set up it can also hit hats and other things on the character. So sometimes it doesn't get the character. Is there any other method that would do it accurately?
Find if it hits a Humanoid