API types < Unit:GetFaction

Gets nFactionID for unit data.

local nFactionID = unit:GetFaction()

Examples Edit

-- Determine if Exile Human or Cassian
local strRaceString = ""
local nRaceID = unit:GetRaceId()
local nFactionID = unit:GetFaction()
if nRaceID == GameLib.CodeEnumRace.Human then
    if nFactionID == Unit.CodeEnumFaction.ExilesPlayer then
        strRaceString = Apollo.GetString("CRB_ExileHuman")
    elseif nFactionID == Unit.CodeEnumFaction.DominionPlayer then
        strRaceString = Apollo.GetString("CRB_Cassian")

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.