I am testing a small Lua script that simply prints the CurrentHPs for each group member. Here's the code:
As you can see, there's a FOR loop that runs through all the group members, and then it prints their CleanName() and their CurrentHPs(). The names are properly displayed, but the HPs actually ONLY works for the first group member - all the rest are printed as 100 HPs. See screenshot:

Any idea why the FOR loop only gets the CurrentHPs() right for the first group member?
Code:
local mq = require('mq')
if not package.loaded['events'] then
print('This script is intended to be imported to Lua Event Manager (LEM). Try "\a-t/lua run lem\a-x"')
end
local function on_load()
-- Perform any initial setup here when the event is loaded.
end
for i=0,mq.TLO.Group.Members() do
print('Group member ', mq.TLO.Group.Member(i).CleanName() , ' currently has ', mq.TLO.Group.Member(i).CurrentHPs(), ' HPs')
end
local function condition()
end
local function action()
end
return {onload=on_load, condfunc=condition, actionfunc=action}
As you can see, there's a FOR loop that runs through all the group members, and then it prints their CleanName() and their CurrentHPs(). The names are properly displayed, but the HPs actually ONLY works for the first group member - all the rest are printed as 100 HPs. See screenshot:

Any idea why the FOR loop only gets the CurrentHPs() right for the first group member?

