WoW API: UnitInRange

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

WoW API < UnitInRange

Returns 1 if the unit is in range of most helpful spells (40yds) and in a group / raid with you, otherwise nil.

isTrue = UnitInRange("unit")

ArgumentsEdit

unit
String - unitId to check.

ReturnsEdit

isTrue
1 or nil

ExampleEdit

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

ResultEdit

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

DetailsEdit

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

See alsoEdit