debouncer

It's a scope issue.

There is a global variable currentmillis declared as an unsigned long. When you use the global variable, both loop() and Button() can use the global variable, and they use the same one.

When you declare unsigned long currentmillis inside your loop() function, it allocates another local variable named currentmillis, and sets it to millis(). This is not the same variable as the global currentmillis. Your Button() function cannot access the local variable in the loop() function. It uses the global currentmillis variable instead. But that variable has not been set.