Skip to content

function setPlayerInvisible

This function will toggle the player invisiblity for all players.
The invisible player will still see other visible players.
Original: setPlayerInvisible

Declaration

async def setPlayerInvisible(id : int, toggle : bool)

Parameters

int id: the player id.
bool toggle: true if the player should be invisible for all players, otherwise false.

Source code in src/pyg2o/functions/player.py
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
async def setPlayerInvisible(id : int, toggle : bool):
    """
    This function will toggle the player invisiblity for all players.
    The invisible player will still see other visible players.
    Original: [setPlayerInvisible](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/setPlayerInvisible/)

    ## Declaration
    ```python
    async def setPlayerInvisible(id : int, toggle : bool)
    ```
    ## Parameters
    `int` **id**: the player id.
    `bool` **toggle**: `true` if the player should be invisible for all players, otherwise `false`.
    """
    data = f'return {get_call_repr()}'

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