## Question

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
 = { -- number of round
 = {1130, 1}, --  = number of item, vnum and ammount
 = {1131, 1},
 = {1132, 1},
 = {1133, 1},
 = {1134, 1},
 = {1135, 1},
 = {1136, 1},
 = {1137, 1}
},
--- round 2
 = {
 = {1130, 1},
 = {1131, 1},
 = {1132, 1},
 = {1133, 1},
 = {1134, 1},
 = {1135, 1},
 = {1136, 1},
 = {1137, 1}
}
}

local ran = number(1, table.getn(itemsalchemie)) --- this use a number in the round 1?

local ran = number(1, table.getn(itemsalchemie)) --- 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.

## Recommended Posts

• 0
`local ran = itemsalchemie[number(0, table.getn(itemsalchemie))]`
• 1

• 0

Thanks, i go to try it.

• 0

And if i need put a syschat to show the dates?

sychat("itemsalchemie[ran].." "..itemsalchemie[ran].." "..itemsalchemie[ran].." "..itemsalcheme[ran]) <--- this is ok?

• 0

And if i need put a syschat to show the dates?

sychat("itemsalchemie[ran].." "..itemsalchemie[ran].." "..itemsalchemie[ran].." "..itemsalcheme[ran]) <--- this is ok?

itemsalchemie[ran]

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), 1 do
output = output..itemsalchemie[i].." "
end

syschat(output)```
• 1

## Create an account

Register a new account