#why when i only touch once an object it register more than 10 times

1 messages · Page 1 of 1 (latest)

chilly elk
#

Script-
local part = script.Parent
part.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = humanoid.Health - 10 end
end)

chilly elk
#

debounce?

young spoke
#

Basically a cooldown

chilly elk
#

oh

young spoke
#

Ill show u rq

chilly elk
#

ok

#

like i need to add task.wait

junior zenithBOT
#

studio** You are now Level 3! **studio

young spoke
#

local debounce = false

local part = script.Parent
part.Touched:Connect(function(hit)
if debounce then return end
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
debounce = true
humanoid.Health = humanoid.Health - 10
debounce = false
end
end)

#

usually it works like this but you r damaging the plr so lemme fix

#

that should work for gaining points etc though

chilly elk
#

oh ok

young spoke
#

use humanoid:TakeDamage(10) under debounce = true

junior zenithBOT
#

studio** You are now Level 4! **studio

young spoke
#

replace that line

young spoke
#

lmk if it works idk if I typed it correctly cus on mob

#

Should work tho