Skip to main content

PlayerDeathTrackerClient

This item only works when running on the client. Client

Client view of a [PlayerDeathTracker]: reads the death count the server replicates under the player. Binds to every tagged Player.

Retrieve the binder from a ServiceBag with serviceBag:GetService(require("PlayerDeathTrackerClient")).

Properties​

DeathsChanged​

PlayerDeathTrackerClient.DeathsChanged: Signal<number>

Fires with the new death count whenever it changes

Functions​

new​

PlayerDeathTrackerClient.new(
player: Player,
serviceBag: ServiceBag
) → PlayerDeathTrackerClient

Constructs a new PlayerDeathTrackerClient. Should be done via the binder.

GetDeathValue​

PlayerDeathTrackerClient.GetDeathValue(self: PlayerDeathTrackerClient) → IntValue?

Returns the replicated value holding the death count, once it has streamed in

GetPlayer​

PlayerDeathTrackerClient.GetPlayer(self: PlayerDeathTrackerClient) → Player

Returns the player whose deaths are tracked

GetDeaths​

PlayerDeathTrackerClient.GetDeaths(self: PlayerDeathTrackerClient) → number

Returns the number of deaths of the player, 0 until the value has replicated

ObserveDeaths​

PlayerDeathTrackerClient.ObserveDeaths(self: PlayerDeathTrackerClient) → Observable.Observable<number>

Observes the number of deaths of the player. Emits 0 until the value has replicated.

GetKills​

deprecated in 10.60.0
</>
This was deprecated in 10.60.0
Use [PlayerDeathTrackerClient.GetDeaths]
PlayerDeathTrackerClient.GetKills(self: PlayerDeathTrackerClient) → number

Returns the number of deaths of the player

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new PlayerDeathTrackerClient. Should be done via the binder.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "serviceBag",
                    "desc": "",
                    "lua_type": "ServiceBag"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "PlayerDeathTrackerClient"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 46,
                "path": "src/deathreport/src/Client/Stats/PlayerDeathTrackerClient.lua"
            }
        },
        {
            "name": "GetDeathValue",
            "desc": "Returns the replicated value holding the death count, once it has streamed in",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "PlayerDeathTrackerClient"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "IntValue?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 71,
                "path": "src/deathreport/src/Client/Stats/PlayerDeathTrackerClient.lua"
            }
        },
        {
            "name": "GetPlayer",
            "desc": "Returns the player whose deaths are tracked",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "PlayerDeathTrackerClient"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 84,
                "path": "src/deathreport/src/Client/Stats/PlayerDeathTrackerClient.lua"
            }
        },
        {
            "name": "GetDeaths",
            "desc": "Returns the number of deaths of the player, 0 until the value has replicated",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "PlayerDeathTrackerClient"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 92,
                "path": "src/deathreport/src/Client/Stats/PlayerDeathTrackerClient.lua"
            }
        },
        {
            "name": "GetKills",
            "desc": "Returns the number of deaths of the player",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "PlayerDeathTrackerClient"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "deprecated": {
                "version": "10.60.0",
                "desc": "Use [PlayerDeathTrackerClient.GetDeaths]"
            },
            "source": {
                "line": 103,
                "path": "src/deathreport/src/Client/Stats/PlayerDeathTrackerClient.lua"
            }
        },
        {
            "name": "ObserveDeaths",
            "desc": "Observes the number of deaths of the player. Emits 0 until the value has replicated.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "PlayerDeathTrackerClient"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable.Observable<number>\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 110,
                "path": "src/deathreport/src/Client/Stats/PlayerDeathTrackerClient.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "DeathsChanged",
            "desc": "Fires with the new death count whenever it changes",
            "lua_type": "Signal<number>",
            "source": {
                "line": 56,
                "path": "src/deathreport/src/Client/Stats/PlayerDeathTrackerClient.lua"
            }
        }
    ],
    "types": [],
    "name": "PlayerDeathTrackerClient",
    "desc": "Client view of a [PlayerDeathTracker]: reads the death count the server replicates under the\nplayer. Binds to every tagged [Player].\n\nRetrieve the binder from a [ServiceBag] with `serviceBag:GetService(require(\"PlayerDeathTrackerClient\"))`.",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 11,
        "path": "src/deathreport/src/Client/Stats/PlayerDeathTrackerClient.lua"
    }
}