GetPlayerWeapon
The weapon the damage model charges the player’s hits to.
The table name of the melee weapon the player has equipped and drawn (shortswordBroad, longSwordDuel …), as the
weapon argument of OnPlayerDamage names it; "" bare-handed, with the weapon sheathed, or without the tables export.
GetItemInfo turns the name into its catalogue entry.
Syntax
Section titled “Syntax”GetPlayerWeapon(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”string - the weapon’s name; "" when none
Example
Section titled “Example”local weapon = GetPlayerWeapon(pid)if weapon ~= "" then local info = GetItemInfo(weapon) SendClientMessage(pid, COLOUR_SERVER, "you fight with " .. (info and info.display ~= "" and info.display or weapon))endSee also
Section titled “See also”GetPlayerEquipment · GetItemInfo · OnPlayerDamage · the Combat group of the index
