Desculpe minha ignorância, mas será que você se importa de me explicar mais detalhadamente, não consegui entender
Mas de qualquer forma levou meu rep+...
Muito obrigada por tentar ajudar...
Depois de muito quebrar a cabeça... Meu script ficou assim:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local t = {
sign = {{level = {0,9}, percent = 25, itemid = {1293, 1294, 1295}},
{level = {10,14}, percent = 30, itemid = {1293, 1294, 1295, 2150}},
{level = {15,19}, percent = 35, itemid = {1293, 1294, 1295, 2150, 2149}},
{level = {20,24}, percent = 40, itemid = {1293, 1294, 1295, 2150, 2149, 2146}},
{level = {25,29}, percent = 45, itemid = {1293, 1294, 1295, 2150, 2149, 2146, 2147}},
{level = {30,34}, percent = 50, itemid = {1293, 1294, 1295, 2150, 2149, 2146, 2147, 9970}},
{level = {35,39}, percent = 50, itemid = {1293, 1294, 1295, 2150, 2149, 2146, 2147, 9970, 2145}},
{level = {40,44}, percent = 50, itemid = {1293, 1294, 1295, 2150, 2149, 2146, 2147, 9970, 2145, 2157}},
{level = {45,49}, percent = 50, itemid = {1293, 1294, 1295, 2150, 2149, 2146, 2147, 9970, 2145, 2157, 2154}},
{level = {50,54}, percent = 50, itemid = {1293, 1294, 1295, 2150, 2149, 2146, 2147, 9970, 2145, 2157, 2154, 2156}},
{level = {55,59}, percent = 50, itemid = {1293, 1294, 1295, 2150, 2149, 2146, 2147, 9970, 2145, 2157, 2154, 2156, 2153}},
{level = {60,64}, percent = 50, itemid = {1293, 1294, 1295, 2150, 2149, 2146, 2147, 9970, 2145, 2157, 2154, 2156, 2153, 2155}},
{level = {70, 1000}, percent = 50, itemid = {1293, 1294, 1295, 2150, 2149, 2146, 2147, 9970, 2145, 2157, 2154, 2156, 2153, 2155, 2177}}}
}
if itemEx.actionid == 1515 then
setPlayerStorageValue(cid, 101, getPlayerStorageValue(cid, 101)+1)
print('Skill Try: '.. getPlayerStorageValue(cid, 101) .. ' Skill Level:' .. getPlayerStorageValue(cid,102) .. ' A+B: ' .. getPlayerStorageValue(cid,103) + getPlayerStorageValue(cid,104))
for Q = 1, #t.sign do
if getPlayerStorageValue(cid, 102) >= t.sign[Q].level[1] and getPlayerStorageValue(cid, 102) <= t.sign[Q].level[2] then
percent = t.sign[Q].percent
itemid = t.sign[Q].itemid[math.random(1,#t.sign[Q].itemid)]
break
end
end
doSendMagicEffect(toPosition, CONST_ME_POFF)
if math.random(20,100) <= percent then
doPlayerAddItem(cid, itemid , 1)
else
doSendAnimatedText(toPosition, 'Tick', 210)
end
if getPlayerStorageValue(cid, 101) == getPlayerStorageValue(cid, 103)+getPlayerStorageValue(cid, 104) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Você avançou sua habilidade em mineração para o nível '.. getPlayerStorageValue(cid, 102)+1 .. '.')
setPlayerStorageValue(cid, 103, getPlayerStorageValue(cid, 103)+getPlayerStorageValue(cid, 104))
setPlayerStorageValue(cid, 104, getPlayerStorageValue(cid, 104)+getPlayerStorageValue(cid, 105))
setPlayerStorageValue(cid, 105, getPlayerStorageValue(cid, 105)+10)
setPlayerStorageValue(cid, 102, getPlayerStorageValue(cid, 102)+1)
end
end
return true
end
Mas sinto que ele esta grotesco e ate ira causar leg quando muitas pessoas estiverem mineirando... E eu adoraria aprender tecnicas mais avançadas ;D