Skip to content

function equipItem

Note

If you want to equip weapon/shield, first make sure that player is in WEAPONMODE_NONE.

This function is used to equip item on player for all players.
Original: equipItem

Declaration

async def equipItem(id : int, instance : str, slotId : int = -1)

Parameters

int id: the player id.
str instance: the item instance from Daedalus scripts.
int slotId: the slot id in which you want to equip item on player, e.g scrolls, runes, rings, by default the item will be equipped on the first free slot.

Source code in src/pyg2o/functions/player.py
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
async def equipItem(id : int, instance : str, slotId : int = -1):
    """
    !!! note
        If you want to equip weapon/shield, first make sure that player is in `WEAPONMODE_NONE`.
    This function is used to equip item on player for all players.
    Original: [equipItem](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/equipItem/)

    ## Declaration
    ```python
    async def equipItem(id : int, instance : str, slotId : int = -1)
    ```
    ## Parameters
    `int` **id**: the player id.
    `str` **instance**: the item instance from Daedalus scripts.
    `int` **slotId**: the slot id in which you want to equip item on player, e.g scrolls, runes, rings, by default the item will be equipped on the first free slot.
    """
    data = f'return {get_call_repr()}'

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