|
| 07 Oct 2015 06:55 PM |
local getValue = tabull[rand(#tabull)] print(getValue) -- prints apple
I want to get the number of apple inside the table
|
|
|
| Report Abuse |
|
|
| 07 Oct 2015 07:21 PM |
local froots = {"Hinges","Oranges","Peaches","Pears","Plums","Apples"} local getElementPosition = function(tab,element) for i = 1,#tab do if tab[i] == element then return i end end end
print(getElementPosition(froots,"Apples"))
morashsPeasant is happy |
|
|
| Report Abuse |
|