Postado Junho 5, 2021 3 anos local cfg = { item = 7590, infinite = true, --Poderá pegar o item infinitas vezes? [true/sim] [false/não] tempo = 10, -- tempo em segundos para o item sumir. storage = 91991, -- storage para o exhaust. exstTime = 50 -- tempo em segundos do exhausted. } local storage = 91838 function onCastSpell(cid, var) if getPlayerStorageValue(cid, cfg.storage) > os.time() then return doPlayerSendCancel(cid, "Aguarde ", getPlayerStorageValue(cid, cfg.storage) - os.time() ," segundos para usar novamente.") and false end if cfg.infinite then doPlayerAddItem(cid, cfg.item, 1) addEvent(doPlayerRemoveItem, cfg.tempo*1000, cid, cfg.item, 1) setPlayerStorageValue(cid, cfg.storage, os.time()+(cfg.exstTime*1000)) else if getPlayerStorageValue(cid, storage) < 1 then doPlayerAddItem(cid, item, 1) addEvent(doPlayerRemoveItem, cfg.tempo*1000, cid, cfg.item, 1) setPlayerStorageValue(cid, storage, 1) setPlayerStorageValue(cid, cfg.storage, os.time()+(cfg.exstTime*1000)) else return doPlayerSendCancel(cid, "Você já pegou seu item.") end end return true end
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.