I'm trying to create a simple script that will give an item to anyone who help destroy a metin. So far the script is:
quest metin_8002_killed begin
state start begin
when 8002.kill begin
local pids = {party.get_member_pids()}
for i, pid in next, pids, nil do
q.begin_other_pc_block(pid)
pc.give_item2(1000, 1)
q.end_other_pc_block()
end
end
end
end
This only works when people are in a party. If there is just one player, or more attacking, no one get anything. If I add the give_item2 before the for, only one player gets the item.
what I'm trying to achieve is something like
local pids = {getAllPlayerPidsThatDamagedTheMob()}
is this possible?