So I've made a bullet, that deals damage, but I've noticed that it kills the humaoid (zombies) instantly. What do I want to achieve: -When the bullet touches a humanoid it only damages it once. -And don't delete the bullet, when it touches a humanoid, so once bullet can touch more humanoids. my script:
local bullet = script.Parent
local function onTouch(partOther)
local humanOther = partOther.Parent:FindFirstChild("Humanoid")
if not humanOther then return end
if humanOther.Parent == bullet then return end
if game.Players:GetPlayerFromCharacter(partOther.Parent) then return end
humanOther:TakeDamage(25)
end
script.Parent.Touched:Connect(onTouch)
Thanks for reading!

4 comments
Thanks for you reply, but now it says "Workspace.Bullet.BulletDamageScript:15: attempt to call a nil value " line 15 is "table.add(damaged, humanOther)", how can I fix this?
oopsies its table.insert(damaged, humanOther) sorry
Yep, it's working! Thank you!
Yep, it's working! Thank you!