Fun facts:
UnitFactionGroup("player") is available only after PLAYER_LOGIN, whereas
UnitRace("player") is always available.
So if you need to check your own faction at the beginning, you'd have to check:
local _,race = UnitRace("player")
local faction = (race == "TAUREN" or race == "ORC" or race == "TROLL" or race == "SCOURGE") and FACTION_HORDE or FACTION_ALLIANCE
|