Skip to content

GetParty

The party as the server last sent it.

id is 0 in no party. members come in join order, your own player among them; each has the pid, the name, the mode’s label, and the vitals of the last update - health, maxHealth, stamina, maxStamina, injuries (bits as the game’s body parts 1-6), dead, bleeding, loading (not in the world), x, y, z when the server sent a position - with vitals false until the first update arrived (your own entry never has them: the game’s HUD does). frames says whether the server’s frames are shown to this player. Read it live; a copy goes stale within half a second.

GetParty()

table - {id = number, leader = pid, name = string, frames = boolean, members = {{pid, name, label, health, maxHealth, stamina, maxStamina, injuries, dead, bleeding, loading, vitals, x, y, z}, ...}}

-- the weakest other member, for a script that marks who needs help
local function weakest()
local party, best, low = GetParty(), nil, 2
if party.id == 0 then return nil end
for _, m in ipairs(party.members) do
if m.pid ~= GetPlayerId() and m.vitals and not m.dead and m.maxHealth > 0 and m.health / m.maxHealth < low then
best, low = m, m.health / m.maxHealth
end
end
return best
end

OnPartyChange · GetPlayerId · the The party group of the index