im trying to make it so when u touch a part it doesn’t do a touch event multiple times
i researched and adding a debounce is supposly supposed to work
so when i added one, the debounce isn’t working.
de = false
part.Hit1.Touched:Connect(function(hit)
if de then return end
if hit.Parent:FindFirstChild("Humanoid") then
de = true
hit.Parent.Humanoid:TakeDamage(100)
plr.Stats.XP.Value += 100
end
wait(5)
de = false
end)
de = false
part.Hit1.Touched:Connect(function(hit)
if de then return end
if hit.Parent:FindFirstChild("Humanoid") then
de = true
hit.Parent.Humanoid:TakeDamage(100)
plr.Stats.XP.Value += 100
wait(5)
de = false
end
end)