Thanks for clearing up the variable bit.
Getting no error with mine anymore, so thats good. But with both things, the spell casts but there's no message output in /say.
Currently testing it with Repentance, a humanoid only ranged stun.
/script CastSpellByName("Repentance"); ct = SpellCanTargetUnit("target"); if (ct == 1) then SendChatMessage('Repentance on %t', 'Say'); else SpellStopTargeting(); end;
And the improved one from Gello:
/script CastSpellByName("Repentance") if SpellCanTargetUnit("target") then SendChatMessage('Repentance on %t', 'Say') else SpellStopTargeting() end
|