Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API UnitInBattleground

Last wiki revision 2022-07-26

Returns the unit index if the unit is in your battleground. position = UnitInBattleground(unit)

  • unit: : UnitId
  • position: - The position in the battleground raid of the specified unit, "nil" if outside of the battleground, and 0 if "unit" is "player" and player is the last person left standing inside of a finished battleground.

local position = UnitInBattleground("player"); ChatFrame1:AddMessage('Position in battleground raid: ' .. (position or "(?)"));

  • Prints the player's position number in the battleground raid. e.g. (depending on number left in battleground raid when call is made)

Position in battleground raid: (?)

Position in battleground raid: 0

Position in battleground raid: 12

  • If 'UnitInBattleground("player")' call is made ...

Returns nil if outside of a battleground.

Returns '0' if you are the last person inside of a battleground after the match is over, and everybody else has left.

Returns 1-#, where # is the maximum number of players allowed in the battleground raid.

Source

https://warcraft.wiki.gg/wiki/API_UnitInBattleground · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.