Postado Janeiro 9, 2015 10 anos 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
Postado Janeiro 9, 2015 10 anos 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 Janeiro 9, 2015 10 anos por MaXwEllDeN (veja o histórico de edições) -"Supra Omnes Lux Lucis" - Acima de todos brilha a Luz -
Postado Janeiro 9, 2015 10 anos 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 Janeiro 9, 2015 10 anos 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.