# IsSpellInRange is not in World of Warcraft Forever: write C_Spell.IsSpellInRange

Forever 1.60.1 (70959), Interface 16001. An addon that calls `IsSpellInRange` stops at /reload with `attempt to call global 'IsSpellInRange' (a nil value)`. Write `C_Spell.IsSpellInRange`; its arguments and returns may differ from the old IsSpellInRange, read them first. Page: https://wowaddons.gg/forever-api/C_Spell.md

```lua
inRange = C_Spell.IsSpellInRange(spellIdentifier, [targetUnit])
```

Returns true if the current target is within range of the spell; False if out of range; Nil if range check was invalid

Arguments:
- `spellIdentifier`: SpellIdentifier
- `targetUnit`: UnitToken, may be nil. Optional specific target; If not supplied, player's current target (if any) will be used

Returns:
- `inRange`: bool, may be nil. May be nil if the range check was invalid, ie due to unknown/invalid spell, missing/invalid target, etc

---
Make an addon with your AI: tell it "Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it."
