PDA

View Full Version : Random Tables



L!p3
11-26-2012, 08:42 PM
I would like to know if there's anyway to Random tables with Lua. When the character go deposit items in depot or sell items will not always use the same 'sequence'.
local randomDp = math.random(1,3)
if randomDp == 1 then
Self.DepositItems(order1)
elseif randomDp == 2 then
Self.DepositItems(order2)
elseif randomDp == 3 then
Self.DepositItems(order3)
end

I've been thinking this way but It takes too much time to edit, any suggestions?

Spectrus
11-26-2012, 09:02 PM
Regardless of table order, it deposits based on location in container.

L!p3
11-26-2012, 09:11 PM
Regardless of table order, it deposits based on location in container.

Thanks a lot!!