Skip to content

function isNpc

This function checks whether id related to given object is remote NPC.
Original: isNpc

Declaration

async def isNpc(npc_id : int) -> bool

Parameters

int npc_id: the identifier of npc.

Returns

bool: true when object is NPC, otherwise false.

Source code in src/pyg2o/functions/npc.py
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
async def isNpc(npc_id : int) -> bool:
    """
    This function checks whether id related to given object is remote NPC.
    Original: [isNpc](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/isNpc/)

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

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