hi, i was testing FindFirstChild instance but its not working at all, i tried to make it say human touched me when a humanoid touch it, but its not working
script.Parent.Touched:connect(function(onTouched) local Human = onTouched:FindFirstChild("Humanoid") if Human then print("human touched me") end end)
I don't quite know what you're trying to achieve but if you're trying to make it Print when a Humanoid touches it then try this script:
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then print("human touched me") end end)
Any problems then feel free to tell me!
You have to do onTouched.Parent:FindFirstChild("Humanoid")
because onTouched will
only give you the part that touched it, you want to get the parent of the part, which would presumably be a player, and then find the Humanoid
within the player.