script.Parent.Handle.Touched:Connect(function(hit) if db then if not canHit then canHit = true local effect = script.Parent.Handle.Effect:Clone() if hit.Parent:FindFirstChild("Humanoid") then local hitSFX = Instance.new("Sound",hit.Parent.Head); hitSFX.SoundId = "rbxassetid://566593606"; hitSFX:Play() hit.Parent.Humanoid:TakeDamage(25) if con.bloodEffects == true then effect.Parent = hit.Parent.HumanoidRootPart effect.Enabled = true end end wait(1) effect:Destroy() canHit = false end end end)
It is used to identify the object that touched the instances. In this case, we're using it to identify humanoids.
hit.Parent:FindFirstChild("Humanoid")
The script was told to find a child named "Humanoid". It's using a .Parent because the one that's hitting it is gonna be the character's limb. So hit.Parent is used to identify the Character.
If you do this without specifying hit, you're giving yourself a hard job; let's say I want to make a killing part, I will need to get the Character's humanoid that hit the part, right? You don't want to specify it yourself. Especially using a specified variable for it.
That's where the hit comes in handy.
script.Parent.Touched:Connect(function(hit) local Humanoid = hit.Parent:FindFirstChild("Humanoid") if Humanoid then Humanoid.Health = 0 end end)
It defines hit as the limb/part that hits it. Then it finds the Character's Humanoid with hit.Parent:FIndFirstChild(). It then checks if Humanoid is not nil. In this case, it found the Humanoid, executing the rest of the script.
(I'm sorry if this comes off unclear, inform me and I'll try to rewrite it if it's not clear enough.)