Skip to content

function spawnPlayer

Note

Unspawned players can't see other players, items, etc. and are invisible for others.

This function will spawn the player.
Players are always in unspawned state after joining to server or after respawning.
Original: spawnPlayer

Declaration

async def spawnPlayer(id : int)

Parameters

int id: the player id.

Source code in src/pyg2o/functions/player.py
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
async def spawnPlayer(id : int):
    """
    !!! note
        Unspawned players can't see other players, items, etc. and are invisible for others.
    This function will spawn the player.
    Players are always in unspawned state after joining to server or after respawning.
    Original: [spawnPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/spawnPlayer/)

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

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