local Combo1 = RP.PunchEvents.Combo1
local BlockPart = game.Workspace:FindFirstChild("BlockPart")
Combo1.OnServerEvent:Connect(function(plr)
local RigthArm = plr.Character["Right Arm"]
plr.Character.Humanoid:LoadAnimation(script.LightAttackAnims.LightAttack1):Play()
local CanTake = true
local dmg = 5
RigthArm.Touched:Connect(function(hit)
if hit.Parent == plr.Character then return end
if hit.Parent == BlockPart then return end
if hit.Parent:FindFirstChild("Humanoid") and CanTake == true then
local enemyHum = hit.Parent:FindFirstChild("Humanoid")
CanTake = false
enemyHum:TakeDamage(dmg)
end
end)
end)
This script is supposed to return end when it hits block part but when it does it just deals damage can anyone help me?

1 comment
your function runs before you even get to the return end part