[NLG库] GetFrontChar

[复制链接]
发表于 5 天前 | 显示全部楼层 |阅读模式

GetFrontChar
NLG.GetFrontChar(CharIndex, CharType)
函数功能
获取对象面前一格内所有CharType类型的对象数量和对象index列表

参数说明
CharIndex: 数值型 对象index
CharType: 数值型 对象类型
参数补充说明
CharType可选内容包括

%对象类型_全部%
%对象类型_人%
%对象类型_怪%
%对象类型_宠%
%对象类型_NPC%
返回值
返回值为2个,第一个返回值为数量,第二个返回值是lua的table,包含所有对象的对象index。

参考实例
local num, playertbl = NLG.GetFrontChar(index, %对象类型_全部%);
NLG.SystemMessage(index, "面前有"..num.."个。");
  if (num > 0) then
    for i=0,num do
      NLG.SystemMessage(index, "id:"..i..",对象index:"..playertbl[i].."。");
    end
  end
回复

使用道具 举报

快速回复 返回顶部 返回列表