Auto-translated
Instead of UnitCastAimedSpell(unit, spell, target), use startThread(UnitCastAimedSpell, unit, spell, target). The error will still be there, but it won’t affect the script’s further execution.
New here? I'm Roha — want a quick tour?