See the Python reference of this logic brick in
The Message Sensor can be used to detect either text messages or property values. The sensor sends a positive pulse once an appropriate message is sent from anywhere in the engine. It can be set up to only send a pulse upon a message with a specific subject.
See Message Actuator for how to send messages.
See Sensor Common Options for common options.
Specifies the message that must be received to trigger the sensor (this can be left blank).