Hello. I make a counter and use operator “if”
It works but its very huge.
How i can simplify this construction?
man.countboomerangs = 15 man.countboomerangs = man.countboomerangs - 1 local killedcounter = { "0","1","2","3","4","5","6","7","8","9","10"} killedcounter[1] = "images/0.png" killedcounter[2] = "images/1.png" killedcounter[3] = "images/2.png" killedcounter[4] = "images/3.png" killedcounter[5] = "images/4.png" killedcounter[6] = "images/5.png" killedcounter[7] = "images/6.png" killedcounter[8] = "images/7.png" killedcounter[9] = "images/8.png" killedcounter[10] = "images/9.png" if man.countboomerangs == 14 then kilcounter1 = display.newImage(killedcounter[2],70,30) kilcounter2 = display.newImage(killedcounter[5],110,30) elseif man.countboomerangs == 13 then kilcounter1:removeSelf() kilcounter2:removeSelf() kilcounter3 = display.newImage(killedcounter[2],70,30) kilcounter4 = display.newImage(killedcounter[4],110,30) elseif man.countboomerangs == 12 then ...