WoW API: UnitInVehicle

From AddOn Studio
Revision as of 04:47, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API UnitInVehicle to API UnitInVehicle without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WoW API < UnitInVehicle

Checks whether a specified unit is within an vehicle.

Arguments

unit
the Unit to check

Returns

isTrue isTrue - returns 1 if the specified unit is in a vehicle, nil otherwise.

Example

 if UnitInVehicle("target") then
   SendChatMessage("My Target is in a vehicle.", "SAY");
 else
   SendChatMessage("My Target is not in a vehicle.", "SAY");
 end

Result

Says "My Target is in a vehicle." if the target is in a vehicle, "My Target is not in a vehicle." otherwise.