Guys, I want to get Humanoid with function(hit) but i want to use it outside of the function(hit). How do I do that?
Here is My Script
local Knife = script.Parent
local db = true
if db == true then
Knife.Touched:Connect(function(hit)
local Humanoid = hit.Parent:WaitForChild("Humanoid")
end)
Humanoid:TakeDamage(1)
end

2 comments
The .Touched event doesn't yield, so when it tries to damage the humanoid, it would always be nil. You'd either want to loop until the humanoid or wait a bit then check if humanoid exists.
Pretty sure this is to inside a sword script, but checking if a humanoid exists might be a smart idea to be honest