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

Part Damaging multiple humanoids?

Asked by 6 years ago
Edited 6 years ago

Im tryna make a Projectile damage multiple humanoid at once. The only thing is it damages 1 humanoid at once. I put a group of humanoids in a spot and shot a projectile at them, only ones was damaged or it didn't even damage at all. Please help, this is what I have

DamageImpact = Power.Touched:Connect(function(hit)
            DamageImpact:disconnect()
                local HumanoidFound = hit.Parent:WaitForChild('Humanoid')
                if HumanoidFound and HumanoidFound ~= Player.Character:WaitForChild('Humanoid') then
                        print('found')
                            HumanoidFound:TakeDamage(10)
                        end
                end 

        end)

1 answer

Log in to vote
0
Answered by 6 years ago

Maybe this will help?

bullet.Touched:connect(function(pp)
    if not pp.Parent then return end
    if not pp.Parent:FindFirstChild('Humanoid') then return end
    pp.Parent:FindFirstChild('Humanoid'):TakeDamage(5)
end)
Ad

Answer this question