API UnitPhaseReason

Returns the reason if a unit is NOT in the same phase.
 reason = UnitPhaseReason(unit)
==Arguments==
:;unit: : UnitId
==Returns==
:;reason:
Value	Field 	Description
0 	Phasing 	The unit is in a different phase
1 	Sharding 	The unit is in a different shard
2 	WarMode 	The unit has a different war mode
3 	ChromieTime	The unit is in a Timewalking Campaign
==Details==
* Returns nil if the unit is in the same phase.
==Example==
local function PrintPhaseReason(unit)
	local msg
	local reason = UnitPhaseReason(unit)
	if reason == Enum.PhaseReason.WarMode then
		msg = "has a different warmode"
	elseif reason == Enum.PhaseReason.ChromieTime then
		msg = "either of you is doing a Timewalking Campaign"
	elseif reason == Enum.PhaseReason.Phasing then
		msg = "is in a different phase"
	elseif reason == Enum.PhaseReason.Sharding then
		msg = "is in a different shard"
	elseif not reason then
		msg = "is in the same phase"
	end
	print(unit, msg)
end
PrintPhaseReason("party1")
==Patch changes==
==See also==
*