player.valid

Description

Get the validity of the player entity. Checks if they are still a valid entity. Useful when you use timeouts and then the player logs out.

Syntax

readonly valid: boolean;

Real World Example

alt.setTimeout(() => {
    // No longer valid. Discarding timeout.
    if (!player.valid) {
        return;
    }

    // Do some stuff later.
}, 5000);

results matching ""

    No results matching ""