Forum

> > CS2D > Scripts > This Lua Working, but Nothing Action?
Forums overviewCS2D overview Scripts overviewLog in to reply

English This Lua Working, but Nothing Action?

3 replies
To the start Previous 1 Next To the start

old This Lua Working, but Nothing Action?

Rygna
User Off Offline

Quote
Hello!
i have trouble with my scripts
My scripts is Working fine And hook is added to cs2d.
but i click it is not any action?
can you fix this?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--------- EXAMPLE -----------
addhook("attack", "_attack")
function _attack(id)
     reqcld(id, 2);
end

addhook("clientdata", "_cd")
function _cd(id, mode, data1, data2)
     if mode == 2 then
          if data1 > 1 and data1 < 2 then
     		if data2 > 4 and data2 < 5 then
         		 msg("Test")
     		end
		end
     end
end

#SorryForMyEnglish.
Thanks.

old Re: This Lua Working, but Nothing Action?

Zeik
User Off Offline

Quote
Well, you obviously don't know what it does yet you expect it to do somethig.

It won't work because you need to click in a super small area. It's actually impossible to click in between these ranges (1 < x < 2) & (4 < y < 5). You will need to increase this area.
More >

For example, you can change it to something like:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("attack", "_attack")
function _attack(id)
     reqcld(id, 2);
end

addhook("clientdata", "_cd")
function _cd(id, mode, data1, data2)
     if mode == 2 then
          if data1 >= 100 and data1 <= 200 then
               if data2 >= 400 and data2 <= 500 then
                    msg("Test")
               end
          end
     end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview