> For the complete documentation index, see [llms.txt](https://rocket-networking.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rocket-networking.gitbook.io/docs/rocket-networking-code/private-messaging/callback_receivedevent.md).

# callback\_ReceivedEvent

After a successful event send on your server, the callback function **callback\_ReceivedEvent()** is called. So under Scripts/Rocket Networking/Callback Functions , you can edit this to do whatever you want…

### Example Implementation of callback

<figure><img src="/files/Vta6czsjXCnF1bZE1B98" alt=""><figcaption></figcaption></figure>

* In a shooter game, if you hit another player, you want to inform them that their health reduced right?
* You can send an event with the eventName "damage"
* And in the message struct you can put some specifics, like how much damage should be dealt
* The receiver can see the message and use the switch statement to reude their player's health by whatever is asked in the messageStruct, and also get the attacker's name directly.

```
function callback_ReceivedEvent(eventName, theMessageStruct , senderClientId){
	switch(eventName){
	
	
		case "damage":   
		health -= theMessageStruct.damageDealt ;
		show_message("You were attached by "+ theMessageStruct.attackerName)
		break;
	
	}

}
```
