# Polling Player Health

Because we do not have event listeners for detecting damage events in relation to players, we have to poll their health values and monitor them for changes if we want to produce outputs whenever a player is damaged.\
\
The script below provides an example for how to do this.

* Store player health+shields in a variable scoped to each player.
* Compare this value to each player's current health+shields every tick.
* If the current value is lower than the stored value, output a damage event in relation to the damaged player.

<div><figure><img src="https://264187692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq39qopWeWNs74JJEWw4C%2Fuploads%2Fgit-blob-8d52a0870b74d272d9024549670d13f12e1bcafb%2Fpoll-health-1.jpg?alt=media" alt=""><figcaption></figcaption></figure> <figure><img src="https://264187692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq39qopWeWNs74JJEWw4C%2Fuploads%2Fgit-blob-b5a1ec2705109b2edf75074809684b529a8b7042%2Fpoll-health-2.jpg?alt=media" alt=""><figcaption></figcaption></figure></div>

**Contributors**\
Captain Punch\
RellimJoe
