> For the complete documentation index, see [llms.txt](https://wiki.thescriptersguild.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.thescriptersguild.com/knowledge/scripting/guides-and-info/polling-player-health.md).

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

**Contributors**\
Captain Punch\
RellimJoe
