Skip to content

function destroyNpc

This function destroys remote NPC.
Original: destroyNpc

Declaration

async def destroyNpc(npc_id : int) -> bool

Parameters

int npc_id: the identifier of npc.

Returns

bool: true when npc was successfully destroyed, otherwise false`.

Source code in src/pyg2o/functions/npc.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
async def destroyNpc(npc_id : int) -> bool:
    """
    This function destroys remote NPC.
    Original: [destroyNpc](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/destroyNpc/)

    ## Declaration
    ```python
    async def destroyNpc(npc_id : int) -> bool
    ```
    ## Parameters
    `int` **npc_id**: the identifier of npc.
    ## Returns
    `bool`: `true` when npc was successfully destroyed, otherwise false`.
    """
    data = f'return {get_call_repr()}'

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