What are you trying to achieve? It just seems like your current code only checks whether or not the parent of the parent of the script finds a humanoid.
There’s a few things I’m noting as I read this script.
I assume you’re putting this in a part, and wish to detect if a player’s character touched it.
Try this:
script.Parent.Touched:Connect(function(o)
local model = o:FindFirstAncestorWhichIsA("Model")
if model and model:FindFirstChild("Humanoid",true) then
print("working!")
end
end)
Yeah i’ve tested this in a new place, even have collisions off… it works. Script is under the part.
Hmmm if its a lot of parts (model), may want to do this differently… maybe have a large invisible box in the model, that’s welded, and has the script running under it.
script.Parent.Touched:Connect(function(HitObject)
local h = HitObject:FindFirstAncestorOfClass("Model"):FindFirstChild("Hmanoid")
if h then
print("working!")
end
end)