Death Tracker package

The Death Tracker script can be used to keep a track of how many times players in your game have died, along with a saved record of their lowest deaths at a predetermined end point. For example, at the end of an obstacle course.

To install the package search for Death Tracker in the community tab. Then there are 2 script folders that you will need to set up…

  • User Death Tracker - Drag this onto the user template to get the scoreboard and the save/load logic
  • Death Tracker Logic - Drag this into the world to get the logic that updates the scoreboard for all users

Once those folders are in place you’ll need to set up a couple more things depending on the game you’re making.

Tell the tracker when a player has died
In the users new death tracker script folder is a script that has a function called OnUserDied. When a player dies in your game you will need to call this on their user to ensure their death count incremements.

Tell the tracker when the game has ended
In that same script is a function called OnCourseComplete which will handle the logic for saving the record and resetting the current death count. I.e. player:GetUser():SendToScripts("OnCourseComplete")

See here for an example of how to call OnCourseComplete with a trigger: