Postado Junho 30, 2016 8 anos Em 30/06/2016 em 15:51, xWhiteWolf disse: não, vc só faz 1 script e troca o if isInArray por essa linha que eu fiz aí, aí depois, dependendo de como vc quiser o sistema vc coloca essas linhas abaixo (se colocar abaixo do if math.random vc só vai poder minerar dnv 1 segundo dps naquele piso após conseguir algum premio) se colocar antes vc vai precisar esperar 1 segundo mesmo q não ganhe nada. setPlayerStorageValue(cid, 1020, toPosition.x) setPlayerStorageValue(cid, 1021, toPosition.y) setPlayerStorageValue(cid, 1022, toPosition.z) setPlayerStorageValue(cid, 1023, os.time()) Tudo 100%, eu so nao to conseguindo alterar o tempo.. pra enveiz de 1 segundo, 1 minuto... poderia responder so mais essa? hahaha
Postado Junho 30, 2016 8 anos Autor Em 30/06/2016 em 16:05, elipe disse: Tudo 100%, eu so nao to conseguindo alterar o tempo.. pra enveiz de 1 segundo, 1 minuto... poderia responder so mais essa? hahaha setPlayerStorageValue(cid, 1023, os.time()) em vez de setar como os.time() sete como os.time() + 59, assim vc em vez de colocar 1 segundo, vc coloca 1 + 59 segundos, que dá 1 minuto. Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Junho 30, 2016 8 anos Em 30/06/2016 em 16:44, xWhiteWolf disse: setPlayerStorageValue(cid, 1023, os.time()) em vez de setar como os.time() sete como os.time() + 59, assim vc em vez de colocar 1 segundo, vc coloca 1 + 59 segundos, que dá 1 minuto. terra = {9192,9193,9194,354,355} levels = { [-1] = 2229, ---- skull [0] = 1294, --- small stone [1] = 3976, --- worm [10] = 2149, -- Small Emerald [12] = 2146, -- Small Sapphire [15] = 2145, -- Small Diamond [17] = 2150, -- Small Amethyst [20] = 2147, -- Small Ruby [25] = 2144, -- Black Pearls [27] = 2143, -- White Pearls [30] = 2157, -- Gold Nuggets [35] = 2156, --- red gem [36] = 2158, -- blue gem [37] = 2155, -- green gem [38] = 2153, -- violet gem [39] = 2154, -- yellow gem [40] = 7761, -- small enchanted emerald [42] = 7759, -- Small Enchanted Sapphiire [45] = 7762, -- Small Enchanted Amethyst [50] = 7760, -- Small Enchanted Ruby [70] = 2177 -- Life Crystal } local config = { storage = 19333, chance = 25, --- 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 } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerVocation(cid) ~= 3 then return false end local drops = {} function getDrops(cid) for i= -1,getPlayerStorageValue(cid, config.storage) do if levels then table.insert(drops, levels) end end return true end if isInArray(terra, itemEx.itemid) and (toPosition.x ~= getPlayerStorageValue(cid, 1020) or toPosition.y ~= getPlayerStorageValue(cid, 1021) or toPosition.z ~= getPlayerStorageValue(cid, 1022) or os.time()+59 > getPlayerStorageValue(cid, 1023)) then getDrops(cid) 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) ..".") 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, 3) else doSendMagicEffect(toPosition, 2) return true end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".") else return false end return true end nao deu certo... continua sem podendo fazer um atraz do outro... o script com a nova linha ta aii.. oq eu fiz errado?? :S
Postado Junho 30, 2016 8 anos Autor Mostrar conteúdo oculto terra = {9192,9193,9194,354,355} levels = { [-1] = 2229, ---- skull [0] = 1294, --- small stone [1] = 3976, --- worm [10] = 2149, -- Small Emerald [12] = 2146, -- Small Sapphire [15] = 2145, -- Small Diamond [17] = 2150, -- Small Amethyst [20] = 2147, -- Small Ruby [25] = 2144, -- Black Pearls [27] = 2143, -- White Pearls [30] = 2157, -- Gold Nuggets [35] = 2156, --- red gem [36] = 2158, -- blue gem [37] = 2155, -- green gem [38] = 2153, -- violet gem [39] = 2154, -- yellow gem [40] = 7761, -- small enchanted emerald [42] = 7759, -- Small Enchanted Sapphiire [45] = 7762, -- Small Enchanted Amethyst [50] = 7760, -- Small Enchanted Ruby [70] = 2177 -- Life Crystal } local config = { storage = 19333, chance = 25, --- 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 } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerVocation(cid) ~= 3 then return false end local drops = {} function getDrops(cid) for i= -1,getPlayerStorageValue(cid, config.storage) do if levels then table.insert(drops, levels) end end return true end if isInArray(terra, itemEx.itemid) and (toPosition.x ~= getPlayerStorageValue(cid, 1020) or toPosition.y ~= getPlayerStorageValue(cid, 1021) or toPosition.z ~= getPlayerStorageValue(cid, 1022) or os.time() > getPlayerStorageValue(cid, 1023)) then getDrops(cid) 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) ..".") 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 setPlayerStorageValue(cid, 1020, toPosition.x) setPlayerStorageValue(cid, 1021, toPosition.y) setPlayerStorageValue(cid, 1022, toPosition.z) setPlayerStorageValue(cid, 1023, os.time() + 59) 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, 3) else doSendMagicEffect(toPosition, 2) return true end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".") else return false end return true end era isso q eu tava falando.. Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Junho 30, 2016 8 anos Em 30/06/2016 em 17:45, xWhiteWolf disse: Mostrar conteúdo oculto Mostrar conteúdo oculto terra = {9192,9193,9194,354,355} levels = { [-1] = 2229, ---- skull [0] = 1294, --- small stone [1] = 3976, --- worm [10] = 2149, -- Small Emerald [12] = 2146, -- Small Sapphire [15] = 2145, -- Small Diamond [17] = 2150, -- Small Amethyst [20] = 2147, -- Small Ruby [25] = 2144, -- Black Pearls [27] = 2143, -- White Pearls [30] = 2157, -- Gold Nuggets [35] = 2156, --- red gem [36] = 2158, -- blue gem [37] = 2155, -- green gem [38] = 2153, -- violet gem [39] = 2154, -- yellow gem [40] = 7761, -- small enchanted emerald [42] = 7759, -- Small Enchanted Sapphiire [45] = 7762, -- Small Enchanted Amethyst [50] = 7760, -- Small Enchanted Ruby [70] = 2177 -- Life Crystal } local config = { storage = 19333, chance = 25, --- 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 } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerVocation(cid) ~= 3 then return false end local drops = {} function getDrops(cid) for i= -1,getPlayerStorageValue(cid, config.storage) do if levels then table.insert(drops, levels) end end return true end if isInArray(terra, itemEx.itemid) and (toPosition.x ~= getPlayerStorageValue(cid, 1020) or toPosition.y ~= getPlayerStorageValue(cid, 1021) or toPosition.z ~= getPlayerStorageValue(cid, 1022) or os.time() > getPlayerStorageValue(cid, 1023)) then getDrops(cid) 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) ..".") 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 setPlayerStorageValue(cid, 1020, toPosition.x) setPlayerStorageValue(cid, 1021, toPosition.y) setPlayerStorageValue(cid, 1022, toPosition.z) setPlayerStorageValue(cid, 1023, os.time() + 59) 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, 3) else doSendMagicEffect(toPosition, 2) return true end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".") else return false end return true end era isso q eu tava falando.. O problema do tempo esta resolvido, ele demora 1 min para poder pegar novamente... poreeem, ele nao consegue pegar nada.. ele upar o skill, para de usar como se tivese pego, mas nada aprace, nem msg de que pegou algo :S:S:S:S que tragico haahaha desculpa o incomodo
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.