Postado Fevereiro 14, 2015 10 anos Eai galera , gostaria de saber como faço pra ganhar somente 1 recompensa aleatória dentre todos esses: doItemSetAttribute(doPlayerAddItem(cid, 13401), "name", "C16 Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13402), "name", "Goku Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13403), "name", "Vegeta Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13404), "name", "Trunks Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13405), "name", "Majin Boo Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13406), "name", "Piccolo Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13407), "name", "Son Gohan Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13408), "name", "Chibi Gohan Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13409), "name", "Cell Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13410), "name", "Uub Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13411), "name", "C17 Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13412), "name", "C18 Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13413), "name", "Cooler Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13414), "name", "Tsuful Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13415), "name", "Dende Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13416), "name", "Gotenks Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13417), "name", "Freeza Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13418), "name", "Jenk Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13419), "name", "Kaio Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13420), "name", "Bardock Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13421), "name", "Broly Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13422), "name", "Goten Saiyan Doll / "..getCreatureName(cid).." completou todas tasks") doItemSetAttribute(doPlayerAddItem(cid, 13423), "name", "Trunks Saiyan Doll / "..getCreatureName(cid).." completou todas tasks") Agradeço aos que puderem ajudar xD
Postado Fevereiro 14, 2015 10 anos Solução Tipo isso: local config = { [13401] = "C16 Doll", [13402] = "Goku Doll", [13403] = "Vegeta Doll", } local rand = {} for itemid, _ in pairs(config) do table.insert(rand, itemid) end rand = rand[math.random(#rand)] doItemSetAttribute(doPlayerAddItem(cid, rand), "name", ""..config[rand].." / "..getCreatureName(cid).." completou todas tasks") ?
Postado Fevereiro 14, 2015 10 anos Autor Tipo isso: local config = { [13401] = "C16 Doll", [13402] = "Goku Doll", [13403] = "Vegeta Doll", } local rand = {} for itemid, _ in pairs(config) do table.insert(rand, itemid) end rand = rand[math.random(#rand)] doItemSetAttribute(doPlayerAddItem(cid, rand), "name", ""..config[rand].." / "..getCreatureName(cid).." completou todas tasks") ? Assim mesmo! Reputado e muito obrigado
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.