Lineage 2 Tower Forum

Full Version: user:IsAttacking() not working?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
HI all

im having problems with IsAttacking()

im testing

    LUA Programming
ShowToClient("Attacking",tostring(GetMe():IsAttacking()));



To see if it changes when im not attacking and when i am, and it always says "false"

this is not the correct use of it?
maybe it's for pvp not pve.
im trying to use it in pvp not pve, anyway doesnt matters, if you are attacking a mob or a char you are attacking, its logical
so nobody knows what is happening here?
(11-04-2014 16:54 PM)Tuxevil Wrote: [ -> ]so nobody knows what is happening here?

user:IsAttacking() returns a boolean true or false if user is attacking
can you show us the script that you are using to test the function?
It always return false when im attacking and when im not

It only works on npc/mobs?

    LUA Programming
mytarget = GetTarget();
if mytarget ~= nil and (mytarget:IsEnemy() or mytarget:IsClanWar2Side()) and mytarget:CanSeeMe() and GetMe():IsAttacking() then
	if GetSkills():FindById(1263):IsSkillAvailable() and not mytarget:GotBuff(1263) then
		UseSkillRaw(1263,mytarget:IsClanWar2Side(),false); -- Curse Gloom
	end;
end;

(11-04-2014 22:34 PM)Tuxevil Wrote: [ -> ]It always return false when im attacking and when im not

It only works on npc/mobs?

    LUA Programming
mytarget = GetTarget();
if mytarget ~= nil and (mytarget:IsEnemy() or mytarget:IsClanWar2Side()) and mytarget:CanSeeMe() and GetMe():IsAttacking() then
	if GetSkills():FindById(1263):IsSkillAvailable() and not mytarget:GotBuff(1263) then
 UseSkillRaw(1263,mytarget:IsClanWar2Side(),false); -- Curse Gloom
	end;
end;


This doesn't look like a good script to test out IsAttacking(), you should write something that tests it out specifically so you know for sure whether or not it does work correctly.
(11-04-2014 23:04 PM)tophersoccer Wrote: [ -> ]This doesn't look like a good script to test out IsAttacking(), you should write something that tests it out specifically so you know for sure whether or not it does work correctly.

m8, i will make it easier

run this script and it will return false
    LUA Programming
ShowToClient("ImAttacking",tostring(GetMe():IsAttacking()));



then hit anything and run it again and the return value will still be false
I think IsAttacking refers to autoattack, like with the action Attack, not if you are in combat mode.
Pages: 1 2
Reference URL's