Skip to content

function setPlayerHealth

This function will set the player health points for all players.
Original: setPlayerHealth

Declaration

async def setPlayerHealth(id : int, health : int)

Parameters

int id: the player id.
int health: health points amount.

Source code in src/pyg2o/functions/player.py
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
async def setPlayerHealth(id : int, health : int):
    """
    This function will set the player health points for all players.
    Original: [setPlayerHealth](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/setPlayerHealth/)

    ## Declaration
    ```python
    async def setPlayerHealth(id : int, health : int)
    ```
    ## Parameters
    `int` **id**: the player id.
    `int` **health**: health points amount.
    """
    data = f'return {get_call_repr()}'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result