Ir para conteúdo

Featured Replies

Postado

Boa noite, alguém poderia me ajudar a colocar um Exhausted de 1 semana nesse item, vlw.

 

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)

local pos = {x=31293, y=32627, z=7}

        -- if getPlayerStorageValue(cid, ZE_isOnZombieArea) > 0 then
            if getPlayerStorageValue(cid, 201201112201) == 1 then
                if getPlayerLevel(cid) >= 500 then
                    if getTilePzInfo(getCreaturePosition(cid)) then
                            doTeleportThing(cid,pos)
                            doSendMagicEffect(getPlayerPosition(cid),66)
                            doSendAnimatedText(getCreaturePosition(cid), "Teleport!", TEXTCOLOR_ORANGE)
                    else
                        doPlayerSendCancel(cid, "You need to be in protection zone.")
                    end
                else
                    doPlayerSendCancel(cid, "Not enough level (500).")
                end
            else
                doPlayerSendCancel(cid, "You need to be epic to use this item.")
            end
        -- else
            -- return doPlayerSendCancel(cid, "You can't use this scroll now.")
        -- end
    return true
end

 

Postado

Não tenho como testar o script.

 

local config ={
	pos = {x=31293, y=32627, z=7},
	tempo = 7*86400, -- 7 dias
	storageTempo = 37,
	level = 500,
	storage = 201201112201
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.storageTempo) > os.time() - config.tempo then
	doPlayerSendCancel(cid, "Voce ainda nao pode usar esse item")
	return false
end

	if getPlayerStorageValue(cid, config.storage) == 1 then
		if getPlayerLevel(cid) >= config.level then
			if getTilePzInfo(getCreaturePosition(cid)) then
				doTeleportThing(cid, config.pos)
				setPlayerStorageValue(cid, config.storageTempo, os.time() + config.tempo)
				doSendMagicEffect(getPlayerPosition(cid),66)
				doSendAnimatedText(getCreaturePosition(cid), "Teleport!", TEXTCOLOR_ORANGE)
			else
				doPlayerSendCancel(cid, "You need to be in protection zone.")
			end
		else
			doPlayerSendCancel(cid, "Not enough level (500).")
		end
	else
		doPlayerSendCancel(cid, "You need to be epic to use this item.")
	end
return true
end

Editado por luiz.marsilio
Correção do tempo (veja o histórico de edições)

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo