de = false
function touch(hit)
	if hit.Name == "Key" or hit.Name == "brick"	 and de == false then
		script.Parent.Size = script.Parent.Size + Vector3.new(1,1,1)								
de = true
wait(3)
de = false
	end
	end
script.Parent.Touched:connect(touch)

my debounce doesnt work it just keeps growing without the 3 seconds debounce

2 comments

0

Im not sure what happenswhen you use or and and inside of a single if then. Maybe because one of them is true, it disregards everything else and runs the code.

0

You can use a nested if statement, the first one to check the debounce and the second one to check what the hit is.