ESP8266, Wifi + clap on/off HELP

I have made a code for a project, but im stuck somewhere?

If you don't know if you are stuck, we certainly can't help you.

Why are you starting ANOTHER thread?

void loop() {
   WiFiClient client = server.available();
  if (!client) {
    return;
  }

If there is no client, do nothing. You can clap until hell freezes over and all you'll get is sore hands.