PIR -Sensor

I am very sorry but I am still kinda noob with the language but how to I make the screaming group you described?

I want
int frequentie = analogRead(pitchPin);
int frequency = map(frequentie, 0, 1023, 100,5000);
int duration = 250;
tone(speakerPin, frequency, duration);
delay(100);
lcd.init();
lcd.backlight();
lcd.print("ALARM");

this in the screaming group.