Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia

Returns true if the unit exists.

exists = UnitExists(unit)

Arguments[]

unit
string : UnitId

Returns[]

exists
boolean - true if the unit exists and is in the current zone, or false if not

Example[]

The snippet below prints a message describing what the player is targeting.

if UnitExists("target") then
 print("You're targeting a " .. UnitName("target"))
else
 print("You have no target")
end