|
Post by noncombat on Jan 22, 2017 11:12:48 GMT
Hello everyone I need some help since I can't get it to work. function checkHBMChances() toast("Gonna check our chances") count = findAll("hbmChance.png") if (count > 1) then toast("We can do HBM") end end But I'm getting this error have tried multiple things, though the table.getn(count) does work. The error : s24.postimg.org/bbly4izdx/error.png
|
|
|
Post by AnkuLua on Jan 22, 2017 11:35:23 GMT
|
|
|
Counting
Jan 22, 2017 15:14:07 GMT
via mobile
Post by noncombat on Jan 22, 2017 15:14:07 GMT
I did the test example, it shows me right amount, do I have to use the test 2 example? I tried multiple things but couldn't get it to where. I want it without the print though.
|
|
|
Post by AnkuLua on Jan 23, 2017 1:42:03 GMT
all = findAll("hbmChance.png") count = table.getn(all) if (count > 1) then ....
|
|
|
Counting
Jan 23, 2017 7:18:55 GMT
via mobile
Post by noncombat on Jan 23, 2017 7:18:55 GMT
all = findAll("hbmChance.png") count = table.getn(all) if (count > 1) then .... I forgot to define the table, feeling stupid. Thanks a lot.
|
|
|
Post by mastercoc on Feb 28, 2017 21:11:28 GMT
how to use table.getn with the region or location, please give me an example!!!
|
|
|
Post by AnkuLua on Mar 1, 2017 1:00:29 GMT
Table is an object with many elements. Such as, table = {Location(3, 5), Location(100, 200)} What do you want to do with the region or location?
|
|
|
Post by mastercoc on Mar 1, 2017 4:16:03 GMT
I need table.getn to look for numbers in the game Clash of Clans,how to ?
|
|
|
Post by AnkuLua on Mar 1, 2017 4:20:15 GMT
|
|
|
Post by mastercoc on Mar 1, 2017 4:23:57 GMT
thanks this really helped me
|
|
|
Post by Mercobots on Mar 2, 2017 14:37:25 GMT
hi i know i'm late but for table count you can use commonLibExtend.zip
if count(findAll("hbmChance.png") > 1 then print("true") else print("false") end
or simple use the # operator if #findAll("hbmChance.png") > 1 then print("true") else print("false") end not tested
|
|