Ir para conteúdo

Featured Replies

Postado
  • Autor

@KotZletY, quando uso potion na área pz aparece "you cannot use this object", não ta exibindo a msg (cid, "Você não pode usar potions em Pz.")

 

@Lost666 não deu certo tambem

  • Respostas 8
  • Visualizações 634
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local MIN = 50 local MAX = 200 local EMPTY_POTION = 7636 local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions

Postado
  • Autor

 

@Vodkart script:

 

local MIN = 50
local MAX = 200
local EMPTY_POTION = 7636

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isPlayer(itemEx.uid) == FALSE then
        return FALSE
    end

if(getTilePzInfo(getCreaturePosition(cid))) then
doPlayerSendCancel(cid, "Você não pode usar potions em Pz.")
return false
end

    if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
        return TRUE
    end

    if doPlayerAddMana(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
        return FALSE
    end

    doAddCondition(cid, exhaust)
    doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
    doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
end

Editado por gabrielbuff (veja o histórico de edições)

Postado
  • Solução
local MIN = 50
local MAX = 200
local EMPTY_POTION = 7636
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isPlayer(itemEx.uid) then
return true
end
if getTilePzInfo(getCreaturePosition(cid)) then
doPlayerSendCancel(cid, "Você não pode usar potions em Pz.") return true
elseif hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
    if doPlayerAddMana(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
        return FALSE
    end
    doAddCondition(cid, exhaust)
    doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
    doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
end

 

Editado por Vodkart (veja o histórico de edições)

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

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 520.1k

Informação Importante

Confirmação de Termo