Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Humanoid not taking damage?

Asked by
Async_io 908 Moderation Voter
8 years ago
handle.Touched:connect(function(hit)
    if equipped and humanoid and humanoid.Health > 0 and hit and hit.Parent.Enemy.Value == true and not hit:isDescendantOf(character)then
        local targethumanoid = hit.Parent:FindFirstChild('Humanoid')
        if targethumanoid and targethumanoid.Health > 0  and not hithumanoid[targethumanoid]then
            print(hit.Name..' has been hit')    
            targethumanoid:TakeDamage(damage*combo)
            hithumanoid[targethumanoid] = true
        end
    end
end)

This is a small chunk of the code. The humanoid I'm trying to hit is a snake, and everything is working as it should, except it taking damage. I put a print in there, and it's printing, it's just not taking damage. I can upload more of the script here if you need more details. Is there any way I can fix this?

1 answer

Log in to vote
0
Answered by
Voltoxus 248 Moderation Voter
8 years ago

Is the combo ever 0 if so that's your problem

Ad

Answer this question