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

Zombie Damages even when their not touching me?

Asked by
Erie20 102
4 years ago
01local Zombie = script.Parent
02local Cooldown =  require(game:GetService("ServerScriptService").ZombieCooldownModule)
03local wave -- for wave stuff
04local debounce
05 
06while true do
07    for _, child in ipairs(Zombie:GetChildren()) do
08        if child:IsA("BasePart") then
09            child.Touched:Connect(function(part)
10                local partParent = part.Parent
11                local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
12 
13                if not humanoid then
14                    return
15                else
View all 31 lines...

The above code is supposed to damage the player when the script parent touches the player. However, even after the player stops touching the script parent, it continues to damage.

I can't figure out the bug, and I'm almost certain that the bug occurs here.

1
Try removing the last 2 lines and the while true do. raid6n 2196 — 4y
0
@raid6n I'll try that. Erie20 102 — 4y

Answer this question