LUACN论坛

 找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
热搜: YJWOW MagicStone BoL
查看: 35|回复: 1

[函数] 请教各位大佬ni按组统计掉血的玩家脚本有没有问题。

[复制链接]
发表于 2024-4-7 09:30:07 | 显示全部楼层 |阅读模式
local one = {}
local two = {}
local three = {}
local four = {}
local five = {}
for i = 1, #ni.members.sort() do
if if ni.unit.distance("player",ni.members[i].name)<=40 and UnitCanAssist("player",ni.members[i].name) and not UnitIsDeadOrGhost(ni.members[i].name) and  ni.members[i]:los() and ni.members[i]:hp() < 75 and ni.members[i]:subgroup == 1 then
table.insert(one, ni.members.[i])
end
for i = 1, #ni.members.sort() do
if if ni.unit.distance("player",ni.members[i].name)<=40 and UnitCanAssist("player",ni.members[i].name) and not UnitIsDeadOrGhost(ni.members[i].name) and  ni.members[i]:los() and ni.members[i]:hp() < 75 and ni.members[i]:subgroup == 2 then
table.insert(two, ni.members.[i])
end
for i = 1, #ni.members.sort() do
if if ni.unit.distance("player",ni.members[i].name)<=40 and UnitCanAssist("player",ni.members[i].name) and not UnitIsDeadOrGhost(ni.members[i].name) and  ni.members[i]:los() and ni.members[i]:hp() < 75 and ni.members[i]:subgroup == 3 then
table.insert(three, ni.members.[i])
end
for i = 1, #ni.members.sort() do
if if ni.unit.distance("player",ni.members[i].name)<=40 and UnitCanAssist("player",ni.members[i].name) and not UnitIsDeadOrGhost(ni.members[i].name) and  ni.members[i]:los() and ni.members[i]:hp() < 75 and ni.members[i]:subgroup == 4 then
table.insert(four, ni.members.[i])
end
for i = 1, #ni.members.sort() do
if if ni.unit.distance("player",ni.members[i].name)<=40 and UnitCanAssist("player",ni.members[i].name) and not UnitIsDeadOrGhost(ni.members[i].name) and  ni.members[i]:los() and ni.members[i]:hp() < 75 and ni.members[i]:subgroup == 5 then
table.insert(five, ni.members.[i])
end

回复

使用道具 举报

发表于 2024-4-7 10:00:03 | 显示全部楼层
为了人民水神,
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

小黑屋|手机版|Archiver|LUACN论坛

GMT+8, 2024-5-4 11:58 PM , Processed in 0.035747 second(s), 14 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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