I put this in my Waypoint File and it will equip a item, but it crashes MM and gives an error Bad Argument #1 to 'sub' (string expected, got boolean) .
I can not get it to work doing the name instead becuase the name has a ' in it and can't seem to make that work.
function EquipItemByID(_ItemID)
local hf_return, hf_itemid, hf_name = inventory:useItem( _ItemID );
if ( hf_return ) then
cprintf(cli.lightblue, language[171], hf_name ); -- Equip Item
else
cprintf(cli.lightred, language[174], _ItemID ); -- Item Not Found
end
inventory:update(); -- update slots
end