Postado Janeiro 21, 2019 6 anos Pessoal boa tarde! Alguém consegue inserir 1 segundo de exaust nesta script?? Valeu!! Mostrar conteúdo oculto terra = {873,4477,4468,4478,4471,4475,4476,1304,4474,8215,8214,3631,3630,1309,5622,5709,5624} levels = { [-1] = 2229, ---- skull 50 [0] = 1294, --- small stone 60 [1] = 3976, --- worm 70 [20] = 2149, -- Small Emerald 80 [30] = 2146, -- Small Sapphire 90 [40] = 2145, -- Small Diamond 100 [50] = 2150, -- Small Amethyst 110 [60] = 2147, -- Small Ruby 120 [70] = 2144, -- Black Pearls 130 [80] = 2143, -- White Pearls 140 [90] = 7761, -- small enchanted emerald 150 [100] = 7759, -- Small Enchanted Sapphiire 160 [110] = 7762, -- Small Enchanted Amethyst 170 [120] = 7760, -- Small Enchanted Ruby 180 } local config = { storage = 19333, chance = 40, --- 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) 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) 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
Postado Janeiro 21, 2019 6 anos Este tópico foi movido para a área correta. Esta é uma mensagem automática!Pedimos que leia as regras do fórum! Mostrar conteúdo oculto This topic has been moved to the correct area. This is an automated message!Please read the forum rules. @eduardo.araujo já respondi inúmeros tópicos com a mesma questão, e em algumas delas eu ensino a adicionar em outros scripts, dê uma procurada!
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.