WoW API < UnitInRange

Returns 1 if the unit is in range (40yds) and "Line of Sight" of most helpful spells, nil otherwise.

isTrue = UnitInRange("unit")

Arguments Edit

String - unitId to check.

Returns Edit

1 or nil

Example Edit

if UnitInRange("target") then
    print(UnitName("target") .. " is 40 yds away.")
elseif not UnitInRange("target") then
    print(UnitName("target") .. " is not in range!")


FarfarawayDPS is 40 yds away.
FarfarawayDPS is not in range!


Returns 'false' for any unit not in party or raid.
Will return nil for hostile units.

See alsoEdit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.