if (string.find(text, "$realm", 1, true)) then --realm name local name, realm = UnitName(unit) if (UnitIsPlayer(unit)) then realm = ""; end text = string.gsub(text, "$realm", realm); end if (string.find(text, "$drealm", 1, true)) then --realm name with a preceeding dash local name, realm = UnitName(unit) if (UnitIsPlayer(unit)) then realm = ""; else realm = "-"..realm; end text = string.gsub(text, "$drealm", realm); end