The problem is at line 13-14.
I have a tool that has a script and a local script. In the local script it fires a **remote event * , which then fires this in my script.
Basically, the enemy still takes damage even after the script has finished. For reference, enf is my debounce. Ehum, is the enemy humanoid
Local enf == true
track.KeyframeReached:connect(function(Punch)
print("shoryuken")
Handle.Touched:connect(function(hit)
if enf ~= false then
local ehum = hit.Parent:FindFirstChild("Humanoid") or
hit.Parent.Parent:FindFirstChild("Humanoid")
enf = false
local bv = Instance.new("BodyVelocity",ehum.Parent.Body)
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = char.Torso.CFrame.lookVector * 50
ehum:TakeDamage(10)
enf = false
game.Debris:AddItem(bv,2)
wait(2)
enf = true
elseif hit ~= hum and enf ~= false then
print(hit.Name)
enf = false
wait(2)
enf = true
end
end)
end)
