Ir para conteúdo

Featured Replies

Postado

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" V89E5aN.png


142c9d3439.jpg
(Não dou suporte por mensagem privada.)

  • Respostas 26
  • Visualizações 1.5k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Jamison Collins
    Jamison Collins

    Bem, vamos à primeira etapa: local daysvalue_ = 30 -- Dias local storage = 50 -- Storage usada function onUse(cid, item, frompos, item2, topos) ------- Não mexer -------- local daysvalue = d

  • Jamison Collins
    Jamison Collins

    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 *

  • Jamison Collins
    Jamison Collins

    Desculpa te perguntar, mas você tem conhecimento suficiente para apenas colocar as scripts em seu devido lugar?

Postado
  • 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 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

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" V89E5aN.png


142c9d3439.jpg
(Não dou suporte por mensagem privada.)

Postado
  • 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
 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo