Postado Setembro 5, 2017 7 anos Autor testa assim, dei uma melhorada no script q ele era bem antigãaao hahaha (espero q funcione) Spoiler terraspecial = {4485} terra = {4471} levels = { [-1] = 2229, ---- skull [0] = 1294, --- small stone [10] = 2149, -- Small Emerald [12] = 2146, -- Small Sapphire [20] = 2145, -- Small Diamond [40] = 2150, -- Small Amethyst [60] = 2147, -- Small Ruby [80] = 2144, -- Black Pearls [100] = 2143, -- White Pearls [120] = 7761, -- small enchanted emerald [140] = 7759, -- Small Enchanted Sapphiire [160] = 7762, -- Small Enchanted Amethyst [180] = 7760, -- Small Enchanted Ruby [200] = 2157 -- Pepita de Ouro } local config = { storage = 19333, chance = 70, --- chance de achar um item ou não k = 2, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante) experience = 19334 } local function getDrops(uid, special) local drops = {} for i = -1, getPlayerStorageValue(uid, config.storage) do if levels[i] then if i >= 12 and not special then return drops end table.insert(drops, levels[i]) end end return drops end function onUse(cid, item, fromPosition, itemEx, toPosition) if isInArray(terra, itemEx.itemid) or isInArray(terraspecial, itemEx.itemid) then local drops = getDrops(cid, isInArray(terraspecial, itemEx.itemid)) doPlayerSetStorageValue(cid, config.experience, getPlayerStorageValue(cid, config.experience)+1) if experience >= (8+(getPlayerStorageValue(cid, config.storage)^2))/config.k then doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+1) doPlayerSendTextMessage(cid, 27, "Congratulations, you have leveled! Your currect level is "..getPlayerStorageValue(cid, config.storage) ..".") doSendMagicEffect(getCreaturePosition(cid),98) doSendAnimatedText(getCreaturePosition(cid), 'Mining UP', 100, cid) if getPlayerStorageValue(cid, config.storage) == 50 then doPlayerSendTextMessage(cid, 20, "For reaching level "..getPlayerStorageValue(cid, config.storage) .." you have been awarded with Mining Helmet.") doPlayerAddItem(cid, 7497, 1, true) end end if config.chance >= math.random(1,100) then if #drops >= 1 then local item = drops[math.random(1,#drops)] doPlayerSendTextMessage(cid, 27, "You have found a "..getItemNameById(item)..".") doPlayerAddItem(cid, item, 1, true) end doSendMagicEffect(toPosition, 289) doSendAnimatedText(toPosition , 'TiickK!', 169) else doSendMagicEffect(toPosition, 288) doSendAnimatedText(toPosition , "Puuff!", 61) return true end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".") end return true end não precisa mais colocar a terra especial na tabela da terra, eu checo ambas agora
Postado Setembro 5, 2017 7 anos 54 minutos atrás, xWhiteWolf disse: testa assim, dei uma melhorada no script q ele era bem antigãaao hahaha (espero q funcione) Mostrar conteúdo oculto terraspecial = {4485} terra = {4471} levels = { [-1] = 2229, ---- skull [0] = 1294, --- small stone [10] = 2149, -- Small Emerald [12] = 2146, -- Small Sapphire [20] = 2145, -- Small Diamond [40] = 2150, -- Small Amethyst [60] = 2147, -- Small Ruby [80] = 2144, -- Black Pearls [100] = 2143, -- White Pearls [120] = 7761, -- small enchanted emerald [140] = 7759, -- Small Enchanted Sapphiire [160] = 7762, -- Small Enchanted Amethyst [180] = 7760, -- Small Enchanted Ruby [200] = 2157 -- Pepita de Ouro } local config = { storage = 19333, chance = 70, --- chance de achar um item ou não k = 2, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante) experience = 19334 } local function getDrops(uid, special) local drops = {} for i = -1, getPlayerStorageValue(uid, config.storage) do if levels[i] then if i >= 12 and not special then return drops end table.insert(drops, levels[i]) end end return drops end function onUse(cid, item, fromPosition, itemEx, toPosition) if isInArray(terra, itemEx.itemid) or isInArray(terraspecial, itemEx.itemid) then local drops = getDrops(cid, isInArray(terraspecial, itemEx.itemid)) doPlayerSetStorageValue(cid, config.experience, getPlayerStorageValue(cid, config.experience)+1) if experience >= (8+(getPlayerStorageValue(cid, config.storage)^2))/config.k then doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+1) doPlayerSendTextMessage(cid, 27, "Congratulations, you have leveled! Your currect level is "..getPlayerStorageValue(cid, config.storage) ..".") doSendMagicEffect(getCreaturePosition(cid),98) doSendAnimatedText(getCreaturePosition(cid), 'Mining UP', 100, cid) if getPlayerStorageValue(cid, config.storage) == 50 then doPlayerSendTextMessage(cid, 20, "For reaching level "..getPlayerStorageValue(cid, config.storage) .." you have been awarded with Mining Helmet.") doPlayerAddItem(cid, 7497, 1, true) end end if config.chance >= math.random(1,100) then if #drops >= 1 then local item = drops[math.random(1,#drops)] doPlayerSendTextMessage(cid, 27, "You have found a "..getItemNameById(item)..".") doPlayerAddItem(cid, item, 1, true) end doSendMagicEffect(toPosition, 289) doSendAnimatedText(toPosition , 'TiickK!', 169) else doSendMagicEffect(toPosition, 288) doSendAnimatedText(toPosition , "Puuff!", 61) return true end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".") end return true end não precisa mais colocar a terra especial na tabela da terra, eu checo ambas agora Agora ele ta dando erro na distro quando eu uso a pick na terra e não ta mais fazendo o tiick/puff > EDIT: consegui arrumar, faltou por uma linha: local experience = getPlayerStorageValue(cid, config.experience) Valeu wolf tu é o bixo, funcionou perfeitamente! seria mais perfeito ainda se a terra special não pegasse pedras dos niveis anteriores, se tiver tempo pra fazer ai, só agradeço! EDIT2: Tentei adicionar mais 1 terra diferente, até consegui que ele dê os tiick e puff, só que não vem pedra nenhuma Se der pra você me ensinar a adicionar novas terras: vou mandar como eu fiz, tem como você me corrigir pra eu aprender? Spoiler terrarica = {4475} terraspecial = {4485} terra = {4471} levels = { [-1] = 2229, ---- skull [0] = 1294, --- small stone [10] = 2149, -- Small Emerald [12] = 2146, -- Small Sapphire [20] = 2145, -- Small Diamond [40] = 2150, -- Small Amethyst [60] = 2147, -- Small Ruby [80] = 2144, -- Black Pearls [100] = 2143, -- White Pearls [120] = 7761, -- small enchanted emerald [140] = 7759, -- Small Enchanted Sapphiire [160] = 7762, -- Small Enchanted Amethyst [180] = 7760, -- Small Enchanted Ruby [200] = 2157 -- Pepita de Ouro } local config = { storage = 19333, chance = 70, --- chance de achar um item ou não k = 2, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante) experience = 19334 } local function getDrops(uid, special, rica) local drops = {} for i = -1, getPlayerStorageValue(uid, config.storage) do if levels[i] then if i >= 12 and not special then if i >= 20 and not rica then return drops end table.insert(drops, levels[i]) end end return drops end end function onUse(cid, item, fromPosition, itemEx, toPosition) if isInArray(terra, itemEx.itemid) or isInArray(terraspecial, itemEx.itemid) or isInArray(terrarica, itemEx.itemid) then local drops = getDrops(cid, isInArray(terraspecial, itemEx.itemid)) local drops = getDrops(cid, isInArray(terrarica, itemEx.itemid)) doPlayerSetStorageValue(cid, config.experience, getPlayerStorageValue(cid, config.experience)+1) local experience = getPlayerStorageValue(cid, config.experience) if experience >= (8+(getPlayerStorageValue(cid, config.storage)^2))/config.k then doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+1) doPlayerSendTextMessage(cid, 27, "Congratulations, you have leveled! Your currect level is "..getPlayerStorageValue(cid, config.storage) ..".") doSendMagicEffect(getCreaturePosition(cid),98) doSendAnimatedText(getCreaturePosition(cid), 'Mining UP', 100, cid) if getPlayerStorageValue(cid, config.storage) == 50 then doPlayerSendTextMessage(cid, 20, "For reaching level "..getPlayerStorageValue(cid, config.storage) .." you have been awarded with Mining Helmet.") doPlayerAddItem(cid, 7497, 1, true) end end if config.chance >= math.random(1,100) then if #drops >= 1 then local item = drops[math.random(1,#drops)] doPlayerSendTextMessage(cid, 27, "You have found a "..getItemNameById(item)..".") doPlayerAddItem(cid, item, 1, true) end doSendMagicEffect(toPosition, 289) doSendAnimatedText(toPosition , 'TiickK!', 169) else doSendMagicEffect(toPosition, 288) doSendAnimatedText(toPosition , "Puuff!", 61) return true end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".") end return true end Editado Setembro 5, 2017 7 anos por Thayguroficial (veja o histórico de edições)
Postado Setembro 5, 2017 7 anos Autor Spoiler local terrarica = {4475} local terraspecial = {4485} local terra = {4471} local levels = { [-1] = 2229, ---- skull [0] = 1294, --- small stone [10] = 2149, -- Small Emerald [12] = 2146, -- Small Sapphire [20] = 2145, -- Small Diamond [40] = 2150, -- Small Amethyst [60] = 2147, -- Small Ruby [80] = 2144, -- Black Pearls [100] = 2143, -- White Pearls [120] = 7761, -- small enchanted emerald [140] = 7759, -- Small Enchanted Sapphiire [160] = 7762, -- Small Enchanted Amethyst [180] = 7760, -- Small Enchanted Ruby [200] = 2157 -- Pepita de Ouro } local config = { storage = 19333, chance = 70, --- chance de achar um item ou não k = 2, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante) experience = 19334 } local function getDrops(uid, special, rica) local drops = {} for lvl, premio in pairs(levels) do if lvl <= getPlayerStorageValue(uid, config.storage) then if (lvl >= 20 and rica) or (lvl >= 12 and special) or lvl < 12 then table.insert(drops, premio) end end end return drops end function onUse(cid, item, fromPosition, itemEx, toPosition) if isInArray(terra, itemEx.itemid) or isInArray(terraspecial, itemEx.itemid) or isInArray(terrarica, itemEx.itemid) then local drops = getDrops(cid, isInArray(terraspecial, itemEx.itemid), isInArray(terrarica, itemEx.itemid)) doPlayerSetStorageValue(cid, config.experience, getPlayerStorageValue(cid, config.experience)+1) local experience = getPlayerStorageValue(cid, config.experience) if experience >= (8+(getPlayerStorageValue(cid, config.storage)^2))/config.k then doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+1) doPlayerSendTextMessage(cid, 27, "Congratulations, you have leveled! Your currect level is "..getPlayerStorageValue(cid, config.storage) ..".") doSendMagicEffect(getCreaturePosition(cid),98) doSendAnimatedText(getCreaturePosition(cid), 'Mining UP', 100, cid) if getPlayerStorageValue(cid, config.storage) == 50 then doPlayerSendTextMessage(cid, 20, "For reaching level "..getPlayerStorageValue(cid, config.storage) .." you have been awarded with Mining Helmet.") doPlayerAddItem(cid, 7497, 1, true) end end if config.chance >= math.random(1,100) then if #drops >= 1 then local item = drops[math.random(1,#drops)] doPlayerSendTextMessage(cid, 27, "You have found a "..getItemNameById(item)..".") doPlayerAddItem(cid, item, 1, true) end doSendMagicEffect(toPosition, 289) doSendAnimatedText(toPosition , 'TiickK!', 169) else doSendMagicEffect(toPosition, 288) doSendAnimatedText(toPosition , "Puuff!", 61) return true end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".") end return true end
Postado Setembro 7, 2017 7 anos Em 05/09/2017 em 19:41, xWhiteWolf disse: Ocultar conteúdo local terrarica = {4475} local terraspecial = {4485} local terra = {4471} local levels = { [-1] = 2229, ---- skull [0] = 1294, --- small stone [10] = 2149, -- Small Emerald [12] = 2146, -- Small Sapphire [20] = 2145, -- Small Diamond [40] = 2150, -- Small Amethyst [60] = 2147, -- Small Ruby [80] = 2144, -- Black Pearls [100] = 2143, -- White Pearls [120] = 7761, -- small enchanted emerald [140] = 7759, -- Small Enchanted Sapphiire [160] = 7762, -- Small Enchanted Amethyst [180] = 7760, -- Small Enchanted Ruby [200] = 2157 -- Pepita de Ouro } local config = { storage = 19333, chance = 70, --- chance de achar um item ou não k = 2, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante) experience = 19334 } local function getDrops(uid, special, rica) local drops = {} for lvl, premio in pairs(levels) do if lvl <= getPlayerStorageValue(uid, config.storage) then if (lvl >= 20 and rica) or (lvl >= 12 and special) or lvl < 12 then table.insert(drops, premio) end end end return drops end function onUse(cid, item, fromPosition, itemEx, toPosition) if isInArray(terra, itemEx.itemid) or isInArray(terraspecial, itemEx.itemid) or isInArray(terrarica, itemEx.itemid) then local drops = getDrops(cid, isInArray(terraspecial, itemEx.itemid), isInArray(terrarica, itemEx.itemid)) doPlayerSetStorageValue(cid, config.experience, getPlayerStorageValue(cid, config.experience)+1) local experience = getPlayerStorageValue(cid, config.experience) if experience >= (8+(getPlayerStorageValue(cid, config.storage)^2))/config.k then doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+1) doPlayerSendTextMessage(cid, 27, "Congratulations, you have leveled! Your currect level is "..getPlayerStorageValue(cid, config.storage) ..".") doSendMagicEffect(getCreaturePosition(cid),98) doSendAnimatedText(getCreaturePosition(cid), 'Mining UP', 100, cid) if getPlayerStorageValue(cid, config.storage) == 50 then doPlayerSendTextMessage(cid, 20, "For reaching level "..getPlayerStorageValue(cid, config.storage) .." you have been awarded with Mining Helmet.") doPlayerAddItem(cid, 7497, 1, true) end end if config.chance >= math.random(1,100) then if #drops >= 1 then local item = drops[math.random(1,#drops)] doPlayerSendTextMessage(cid, 27, "You have found a "..getItemNameById(item)..".") doPlayerAddItem(cid, item, 1, true) end doSendMagicEffect(toPosition, 289) doSendAnimatedText(toPosition , 'TiickK!', 169) else doSendMagicEffect(toPosition, 288) doSendAnimatedText(toPosition , "Puuff!", 61) return true end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".") end return true end A terra special ta pegando o mesmo drop do nivel da rica agora, somente a terra normal ta pegando o drop especifico do nivel que eu setei
Postado Setembro 8, 2017 7 anos Autor cara, vc tem que saber explicar o que vc quer. Ate então tudo que você me pediu foi pra terra melhor só não dar os itens lixos. Se voce quer q seja exclusivo os itens pra cada terra tem outro jeito de fazer
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.