Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Register
Advertisement

Returns info for a player's score in battlefields.

name, killingBlows, honorableKills, deaths, honorGained, faction, race, class, classToken, damageDone, healingDone, bgRating, ratingChange, preMatchMMR, mmrChange, talentSpec = GetBattlefieldScore(index)

Arguments[]

index
number - The characters index in battlegrounds, going from 1 to GetNumBattlefieldScores().

Returns[]

name
string - The player's name, with their server name attached if from a different server to the player.
killingBlows
number - Number of killing blows.
honorableKills
number - Number of honorable kills.
deaths
number - The number of deaths.
honorGained
number - The amount of honour gained so far (Bonus Honour).
faction
number - (Battlegrounds: Horde = 0, Alliance = 1 / Arenas: Green Team = 0, Yellow Team = 1).
race
string - The players race (Orc, Undead, Human, etc).
class
string - The players class (Mage, Hunter, Warrior, etc).
classToken
string - The player's class name in english given in all capitals (MAGE , HUNTER, WARRIOR, etc)
damageDone
number - The amount of damage done.
healingDone
number - The amount of healing done.
talentSpec
string - Localized name of player build

Example[]

How to count the number of players in each faction.

local numScores = GetNumBattlefieldScores()
local numHorde = 0
local numAlliance = 0
for i=1, numScores do
	name, killingBlows, honorableKills, deaths, honorGained, faction = GetBattlefieldScore(i);
	if ( faction ) then
		if ( faction == 0 ) then
			numHorde = numHorde + 1
		else
			numAlliance = numAlliance + 1
		end
	end
end


Advertisement