local debounce = false DMGPart.Touched:connect(function(part) local h = part.Parent:FindFirstChild("Humanoid") if h and not debounce then debounce = true h:TakeDamage(15) print("Not Blocked") wait(0.8) debounce = false if h and h.WalkSpeed == 3 and not debounce then h:TakeDamage(1) print("Blocked") wait(0.8) debounce = false end end end)
If the targets WalkSpeed is equal to 3 then the damage should be 1 however it wont work.
local debounce = false DMGPart.Touched:connect(function(part) local h = part.Parent:FindFirstChild("Humanoid") if h and (h.WalkSpeed == 3) and (not debounce) then h:TakeDamage(1) print("Blocked") wait(0.8) debounce = false elseif h and (not debounce) then debounce = true h:TakeDamage(15) print("Not Blocked") wait(0.8) debounce = false end end)