WoW:API UnitIsSameServer: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Created page with "  {{wowapi}} <!-- List return values and arguments as well as function name, follow Blizzard usage convention for args --> UnitIsSameServer(UnitId, UnitId) Determines if the …")
 
m (Move page script moved page API UnitIsSameServer to API UnitIsSameServer without leaving a redirect)
 
(No difference)

Latest revision as of 04:47, 15 August 2023

 

WoW API < UnitIsSameServer

UnitIsSameServer(UnitId, UnitId)

Determines if the two units supplied are from the same server. It is important to note that it returns nil rather than false, nil is treated like false for most operations but it is *not* a proper boolean.


Arguments
UnitId

Returns
True/nil

Example
if (UnitIsSameServer(UnitId, "player")) then
   --Unit is from the same server as the player
else
   --Unit is from a different server
end