Hmmm, I move the slash command handler to the top, and renamed my function. Works good now.
Code:
function HunterAttack_OnLoad()
SlashCmdList["HUNTERATTACK"] = HunterAttack_SlashHandler;
SLASH_HUNTERATTACK1 = "/hunterattack";
SLASH_HUNTERATTACK2 = "/hatt";
end
function HunterAttack_SlashHandler()
if (IsActionInRange(55)==1) and (IsActionInRange(50)==0) then -- in range for range attack?
RangedAttack()
elseif (IsActionInRange(50)==1) then
MeleeAttack()
end
end
Thanks for all the feedback!