Kuantikum
Member
- Joined
- Jul 3, 2015
- Messages
- 219
- Solutions
- 1
- Reaction score
- 20
Hello,
I need to select 1 npc at random. I was trying something like that:
Can you help me? tyty
I need to select 1 npc at random. I was trying something like that:
Lua:
local npcs = {
{"Raymund Headley", {x = 3037, y = 1692, z = 7}},
{"Charlie Anselm", {x = 3035, y = 1698, z = 7}},
{"Nolan Peter", {x = 3040, y = 1699, z = 7}},
{"Sanford Fulk", {x = 3040, y = 1699, z = 6}},
{"Paulina Megan", {x = 3035, y = 1693, z = 6}},
{"Regena Loraine", {x = 3042, y = 1692, z = 6}},
{"Hettie Sibyl", {x = 3037, y = 1692, z = 8}},
{"Harmonie Rainbow", {x = 3041, y = 1697, z = 5}},
{"Flossie Cherise", {x = 3032, y = 1702, z = 7}},
{"Joetta Mabella", {x = 3038, y = 1694, z = 8}},
}
for i = 1, 5 do
table.remove(npcs, getRandom(1, #npcs))
end
for _, npc in pairs(npcs) do
doCreateNpc(npc[1], npc[2])
end
npcs = table.clear(npcs)
Can you help me? tyty