geovanejr 0 Postado Abril 13, 2010 Share Postado Abril 13, 2010 Alguem Concerta Esse Script Pra Mim? E aqui o script: function onSay(cid, words, param, channel) local toPos = creatureGetLookPosition(cid) if(isInArray({"full", "all"}, param:lower())) then doCleanTile(toPos, false) doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end local amount = 1 param = tonumber(param) if(param) then amount = param end toPos.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then if(isCreature(tmp.uid)) then doRemoveCreature(tmp.uid) else doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount)) end doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end toPos.stackpos = STACKPOS_TOP_FIELD tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount)) doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end toPos.stackpos = STACKPOS_TOP_CREATURE tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then doRemoveCreature(tmp.uid) doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end for i = 5, 1, -1 do toPos.stackpos = i tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then if(isCreature(tmp.uid)) then doRemoveCreature(tmp.uid) else doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount)) end doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end end doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end Link para o comentário https://xtibia.com/forum/topic/130856-alguem-concerta-esse-script-pra-mim/ Compartilhar em outros sites More sharing options...
Antharaz 93 Postado Abril 13, 2010 Share Postado Abril 13, 2010 seu server não tem a função: creatureGetLookPosition(cid) Link para o comentário https://xtibia.com/forum/topic/130856-alguem-concerta-esse-script-pra-mim/#findComment-862503 Compartilhar em outros sites More sharing options...
joaohd 200 Postado Abril 13, 2010 Share Postado Abril 13, 2010 Veja agora: function onSay(cid, words, param, channel) local toPos = getPlayerLookDir(cid) if(isInArray({"full", "all"}, param:lower())) then doCleanTile(toPos, false) doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end local amount = 1 param = tonumber(param) if(param) then amount = param end toPos.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then if(isCreature(tmp.uid)) then doRemoveCreature(tmp.uid) else doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount)) end doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end toPos.stackpos = STACKPOS_TOP_FIELD tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount)) doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end toPos.stackpos = STACKPOS_TOP_CREATURE tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then doRemoveCreature(tmp.uid) doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end for i = 5, 1, -1 do toPos.stackpos = i tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then if(isCreature(tmp.uid)) then doRemoveCreature(tmp.uid) else doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount)) end doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end end doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end flw Link para o comentário https://xtibia.com/forum/topic/130856-alguem-concerta-esse-script-pra-mim/#findComment-862507 Compartilhar em outros sites More sharing options...
geovanejr 0 Postado Abril 13, 2010 Autor Share Postado Abril 13, 2010 Apoca deu esse error aqui: Link para o comentário https://xtibia.com/forum/topic/130856-alguem-concerta-esse-script-pra-mim/#findComment-862515 Compartilhar em outros sites More sharing options...
Antharaz 93 Postado Abril 13, 2010 Share Postado Abril 13, 2010 @geovanejr Você copiou o script de forma que o then ficou junto do doCleanTile, os separe e verifique o restante... depois rode novamente Link para o comentário https://xtibia.com/forum/topic/130856-alguem-concerta-esse-script-pra-mim/#findComment-862516 Compartilhar em outros sites More sharing options...
geovanejr 0 Postado Abril 13, 2010 Autor Share Postado Abril 13, 2010 @Antharaz Aew Antharaz separei tudinho direitinho e rodei denovo, deu esse error aqui: Link para o comentário https://xtibia.com/forum/topic/130856-alguem-concerta-esse-script-pra-mim/#findComment-862520 Compartilhar em outros sites More sharing options...
Antharaz 93 Postado Abril 13, 2010 Share Postado Abril 13, 2010 (editado) As funções do seu ot n batem com as funções do script... deixe o server que você está usando e a versão para achar as funções certas... Editado Abril 13, 2010 por Antharaz Link para o comentário https://xtibia.com/forum/topic/130856-alguem-concerta-esse-script-pra-mim/#findComment-862522 Compartilhar em outros sites More sharing options...
Posts Recomendados