#how to make a debounce on this
5 messages · Page 1 of 1 (latest)
you need to add a then statement after your condition
local KillBrick = script.Parent
local IsTouched = false
KillBrick.Touched:Connect(function(HitPart)
local Humanoid = HitPart.Parent:FindFirstChild("Humanoid")
if Humanoid then
Humanoid.Health -= 25
end
end)
second, your checking if an instance is false, which is not the correct way to check if something exists. you need to see if it exists by checking if it's not nil, which there are two methods for:
if example ~= nil then
-- code here
end
and the better way:
if example then
-- code here
end
@burnt smelt