Postado Maio 16, 2014 11 anos Tenta agora: local daysvalue_ = 30 -- Dias local storage = 50 -- Storage usada function onUse(cid, item, frompos, item2, topos) ------- Não mexer -------- local daysvalue = daysvalue_ * 24 * 60 * 60 local player = Player(cid) local tile = Tile(player:getPosition()) local voc = {5, 6, 7, 8} if tile:hasFlag(TILESTATE_PROTECTIONZONE) == false then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,"You can't transform your vocation in this area.") return false elseif player:getStorageValue(storage) - os.time() >= 0 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wait 30 days to use renew your vocation. Next available will be at: " .. os.date("%c", player:getStorageValue(storage)) .. " (month;day;year and time).") return false end if isInArray(voc, player:getVocation():getId()) == true then Item(item.uid):remove() time = os.time() + daysvalue player:setStorageValue(storage, time) player:setVocation(Vocation(player:getVocation():getId() + 4)) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received "..daysvalue_.." epic promotion days!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are not a promoted vocation!") end return true end 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
Postado Maio 17, 2014 11 anos Autor Tenta agora: local daysvalue_ = 30 -- Dias local storage = 50 -- Storage usada function onUse(cid, item, frompos, item2, topos) ------- Não mexer -------- local daysvalue = daysvalue_ * 24 * 60 * 60 local player = Player(cid) local tile = Tile(player:getPosition()) local voc = {5, 6, 7, 8} if tile:hasFlag(TILESTATE_PROTECTIONZONE) == false then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,"You can't transform your vocation in this area.") return false elseif player:getStorageValue(storage) - os.time() >= 0 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wait 30 days to use renew your vocation. Next available will be at: " .. os.date("%c", player:getStorageValue(storage)) .. " (month;day;year and time).") return false end if isInArray(voc, player:getVocation():getId()) == true then Item(item.uid):remove() time = os.time() + daysvalue player:setStorageValue(storage, time) player:setVocation(Vocation(player:getVocation():getId() + 4)) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received "..daysvalue_.." epic promotion days!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are not a promoted vocation!") end return true end Nice! rep+ Tenho uma pergunta. Quando os dias acabar o player volta pro templo ? Obrigado Editado Maio 17, 2014 11 anos por lamina (veja o histórico de edições) Antica Global - Server Online SITE: http://anticaglobal.com/ IP: anticaglobal.com EXP: 999x [sTAGES] ML: 300x SKILL: 500x LOOT: 10x VERSÃO: 10.77 PORTA: 7171 Stages: 1 - 8 level, 999x 9 - 20 level, 950x 21 - 50 level, 800x 51 - 100 level, 750x 101 - 130 level, 650x 131 - 180 level, 550x 181 - 230 level, 450x 231 - 300 level, 350x 301+ level, 300x
Postado Maio 17, 2014 11 anos Agora segunda etapa do script: Vá até creaturescript > script > login.lua; e depois de local player = Player(cid) você adiciona isso: local storage = 50 -- aqui você coloca a mesma storage do outro script if player:getStorageValue(storage) - os.time() <= 0 then player:setVocation(Vocation(player:getVocation():getId() - 4)) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your epic promotion time has expired.") end 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
Postado Maio 17, 2014 11 anos Autor Tem mais alguma etapa ? Antica Global - Server Online SITE: http://anticaglobal.com/ IP: anticaglobal.com EXP: 999x [sTAGES] ML: 300x SKILL: 500x LOOT: 10x VERSÃO: 10.77 PORTA: 7171 Stages: 1 - 8 level, 999x 9 - 20 level, 950x 21 - 50 level, 800x 51 - 100 level, 750x 101 - 130 level, 650x 131 - 180 level, 550x 181 - 230 level, 450x 231 - 300 level, 350x 301+ level, 300x
Postado Maio 17, 2014 11 anos Não. Apenas isso, assim que o período acabar, e o player der login, ele perderá a vocação. 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
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.