Wikia

WoWWiki

API UnitExists

Talk1
101,312pages on
this wiki
Revision as of 23:20, May 22, 2009 by Speedwaystar (Talk | contribs)

(diff) ←Older revision | Latest revision (diff) | Newer revision → (diff)
WoW API < UnitExists

Determines if the unit exists.

exists = UnitExists("unit")

Parameters Edit

Arguments Edit

("unit")
unit 
String - The UnitId to query (e.g. "player", "party2", "pet", "target" etc.)

Returns Edit

exists 
1 if the unit exists and is in the current zone, or nil if not

Example Edit

Just a simple example:


function 1stBuff()
	if(UnitExists("target")) then 
		MeinZiel="target";
		DEFAULT_CHAT_FRAME:AddMessage("My targets 1st buff: "..(UnitBuff(MeinZiel, 1)));
	else 
		MeinZiel="player";
		DEFAULT_CHAT_FRAME:AddMessage("My own 1st buff: "..(UnitBuff(MeinZiel, 1)));
	end;
end


Around Wikia's network

Random Wiki