ѕeмa™ 308 Posted February 27, 2014 Share Posted February 27, 2014 Hi, i have 1 problem with one array, i'm creating one system but i need make a number in the array. Example: itemsalchemie = { --- round 1 [0] = { -- number of round [0] = {1130, 1}, -- [0] = number of item, vnum and ammount [1] = {1131, 1}, [2] = {1132, 1}, [3] = {1133, 1}, [4] = {1134, 1}, [5] = {1135, 1}, [6] = {1136, 1}, [7] = {1137, 1} }, --- round 2 [1] = { [0] = {1130, 1}, [1] = {1131, 1}, [2] = {1132, 1}, [3] = {1133, 1}, [4] = {1134, 1}, [5] = {1135, 1}, [6] = {1136, 1}, [7] = {1137, 1} } } local ran = number(1, table.getn(itemsalchemie[0])) --- this use a number in the round 1? local ran = number(1, table.getn(itemsalchemie[1])) --- this use a number in the round 2? I need put a number or math.ramdom in the locan ran but, in the round selected Thanks. https://m2admin.net/ Link to comment Share on other sites More sharing options...
Former Staff .InyaProduction 1123 Posted February 27, 2014 Former Staff Share Posted February 27, 2014 local ran = itemsalchemie[0][number(0, table.getn(itemsalchemie[0]))] 1 Link to comment Share on other sites More sharing options...
ѕeмa™ 308 Posted February 27, 2014 Author Share Posted February 27, 2014 Thanks, i go to try it. https://m2admin.net/ Link to comment Share on other sites More sharing options...
ѕeмa™ 308 Posted February 27, 2014 Author Share Posted February 27, 2014 And if i need put a syschat to show the dates? sychat("itemsalchemie[0][ran][1].." "..itemsalchemie[0][ran][2].." "..itemsalchemie[0][ran][3].." "..itemsalcheme[0][ran][4]) <--- this is ok? sorry my bad english. https://m2admin.net/ Link to comment Share on other sites More sharing options...
Former Staff .InyaProduction 1123 Posted February 27, 2014 Former Staff Share Posted February 27, 2014 And if i need put a syschat to show the dates? sychat("itemsalchemie[0][ran][1].." "..itemsalchemie[0][ran][2].." "..itemsalchemie[0][ran][3].." "..itemsalcheme[0][ran][4]) <--- this is ok? sorry my bad english. itemsalchemie[0][ran][1] will return the amount you specified at the top of a random item from table one.. the other give empty table error. if you want to return the whole table: local output = "" for i = 0, table.getn(itemsalchemie[0]), 1 do output = output..itemsalchemie[0][i].." " end syschat(output) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now