Ir para conteúdo

Featured Replies

Postado

function onUse(cid, item, fromPosition, itemEx, toPosition)
doCreateItem(9565, 1, toPosition)
end

want:

 

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

 

if iswalkeable then

doCreateItem(9565, 1, toPosition)

else

doSendMagicEffect(toPosition, 2)

end

 

 

how?

function isWalkable(pos)
    pos.stackpos = 0
    local tile = getThingfromPos(pos, false)
    if tile ~= 0 and not hasProperty(tile.uid, CONST_PROP_BLOCKSOLID) and not isCreature(getTopCreature(pos).uid) then
        return true
    end
end

solved

Resolvido por BennyDz

Ir para solução
Postado

Which position you want to check if is walkeable? The player current position?

 

 

If is solved, maybe you can post the solution. To help other members

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

-"Supra Omnes Lux Lucis"

- Acima de todos brilha a Luz -

5VGnDyBz.png

Postado
  • Autor
  • Solução

I publish the function is resolved my problem, friend but give you an example:

 

I'm looking for it: isWalkable on toPosition.

 

example is solved on actions:

function isWalkable(pos)
    pos.stackpos = 0
    local tile = getThingfromPos(pos, false)
    if tile ~= 0 and not hasProperty(tile.uid, CONST_PROP_BLOCKSOLID) and not isCreature(getTopCreature(pos).uid) then
        return true
    end
end

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

if isWalkable(toPosition) == true then
doSendMagicEffect(toPosition, 54)
doCreateItem(9565, 1, toPosition)
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end
return true
end

Editado por BennyDz (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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo