I’m making a script that drops your health to just 10, everything is going fine except for the fact that the if loop still goes through despite debounce being false, am I doing something wrong?
local brick = script.Parent
local debounce = true
brick.Touched:Connect(function(person)
local Humanoid = person.Parent:FindFirstChild("Humanoid")
local Robloxian = person.Parent
if Humanoid and debounce == true then
debounce = false
print("Health Dropped!")
Humanoid.Health = 10
debounce = true
else
return
end
end)
local brick = script.Parent
local debounce = true
brick.Touched:Connect(function(person)
local Robloxian = person.Parent
local Humanoid = Robloxian:FindFirstChild("Humanoid")
if Humanoid and debounce then
debounce = false
print("Health Dropped!")
Humanoid.Health = 10
task.delay(0.1, function()
debounce = true
end)
end
end)