No categories assigned

LUA:GetItemType

Revision as of 18:37, 24 November 2013 by Thefoof (talk | contribs) (Created page with "= LUA Functions: GetItemType() = This returns the itemtype from an item pointer. ==== Syntax ==== GetItemType(param1) ==== Parameters ==== ; Required - ''param1'' (Item*) : '...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA Functions: GetItemType()

This returns the itemtype from an item pointer.


Syntax

GetItemType(param1)


Parameters

Required - param1 (Item*)
param1 is the item to check itemtype


Usage

function hailed(NPC, Spawn)
    local item = GetEquippedItemBySlot(Spawn, 0)
    Say(NPC, GetItemType(item))
end

When this spawn is hailed, the spawn will say the itemtype value of the item equipped in the player's 0 slot (primary weapon) in chat.