Forum

> > CS2D > Scripts > This Lua Working, but Nothing Action?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch This Lua Working, but Nothing Action?

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt This Lua Working, but Nothing Action?

Rygna
User Off Offline

Zitieren
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.

alt Re: This Lua Working, but Nothing Action?

Zeik
User Off Offline

Zitieren
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.
Mehr >

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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht