local debounce = false DMGPart.Touched:connect(function(part) local h = part.Parent:FindFirstChild("Humanoid") if h and not debounce then debounce = true h:TakeDamage(10) if h.WalkSpeed == 3 and h and not debounce then h:TakeDamage(1)
You're meant to take 10 damage if your walkspeed is not equal to 3. However even when my walkspeed is equal to 3 it still inflicts 10 damage.
The problem is you didn't close your if statments, meaning you forgot to add an end, simple fix like so:
local debounce = false DMGPart.Touched:connect(function(part) local h = part.Parent:FindFirstChild("Humanoid") if h and not debounce then debounce = true h:TakeDamage(10) end if h.WalkSpeed == 3 and h and not debounce then h:TakeDamage(1) end
Hope this helped