Menoxcide 3 Postado Dezembro 30, 2011 Share Postado Dezembro 30, 2011 Galera ta td certo nesse script menos a parte pra remove o monstro, olha só: local storage = 1755 local emGuerra = 1756 local War = { fromPos={x=1349, y=1101, z=7, stackpos=253}, toPos={x=1359, y=1111, z=0, stackpos=253}, rewardRoom = {x=518,y=840,z=7,stackpos=1}} local config = { empe = {x=55, y=34, z=5}, pre1 = {x=68, y=37, z=6}, pre2 = {x=42, y=37, z=6} } local tpId = 1387 local tp = { pos1 = {x=51, y=28, z=6}, pos2 = {x=59, y=28, z=6} } function removeTp(tp) local t = getTileItemById(tp.pos1, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos1, CONST_ME_POFF) end end function removeTeleport(tps) local t = getTileItemById(tp.pos2, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos2, CONST_ME_POFF) end end function onSay(cid, words, param) if param == "open" then setGlobalStorageValue(emGuerra,1) doBroadcastMessage("War of Emperium has began!",22) doSummonCreature("Emperium",config.empe,false) doSummonCreature("Emperium Guard",config.pre1,false) doSummonCreature("Emperium Guardian",config.pre2,false) addEvent(removeTp, 2*1000, tp) addEvent(removeTeleport, 2*1000, tps) return true elseif param == "close" then for _, pid in ipairs(getPlayersOnline()) do if isInArea(getPlayerPosition(pid), War.fromPos, War.toPos) then if getGlobalStorageValue(storage) ~= getPlayerGuildId(pid) then doTeleportThing(pid, War.rewardRoom, false) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE,"Sorry, your guild not win the war!") else doPlayerSendTextMessage(pid,MESSAGE_STATUS_CONSOLE_BLUE,"Your guild has domation the castle. Congratulations to help her!") end end end setGlobalStorageValue(emGuerra,0) doRemoveCreature(cid, config.empe, 1) doBroadcastMessage("The war for the castle has ended!",22) else return doPlayerSendCancel(cid,"Talk /war open[for begin the wr] or /war close[for end the war]") end return true end eu nunca usei esse action doRemoveCreature entao nao sei se tem q estar assin msm: (cid, config.empe, 1) ou se esta td errado...ajuda ae plx Link para o comentário https://xtibia.com/forum/topic/176689-remover-monstro/ Compartilhar em outros sites More sharing options...
139 27 Postado Dezembro 30, 2011 Share Postado Dezembro 30, 2011 (editado) Bom, eu não sei usar essa função também mas tenta aê : doRemoveCreature(config.empe) Editado Dezembro 30, 2011 por 139 Link para o comentário https://xtibia.com/forum/topic/176689-remover-monstro/#findComment-1164715 Compartilhar em outros sites More sharing options...
Menoxcide 3 Postado Dezembro 30, 2011 Autor Share Postado Dezembro 30, 2011 vish continuo dando o msm erro...vo posta ake pra tu ver o erro [Error - TalkAction Interface] data/talkactions/scripts/castlewar-talk.lua:onSay Description: (luaDoRemoveCreature) Creature not found > Broadcasted message: "The war for the castle has ended!". Link para o comentário https://xtibia.com/forum/topic/176689-remover-monstro/#findComment-1164747 Compartilhar em outros sites More sharing options...
139 27 Postado Dezembro 30, 2011 Share Postado Dezembro 30, 2011 (editado) Tenta assim, eu modifiquei no script a parte que remove a criatura: local storage = 1755 local emGuerra = 1756 local War = { fromPos={x=1349, y=1101, z=7, stackpos=253}, toPos={x=1359, y=1111, z=0, stackpos=253}, rewardRoom = {x=518,y=840,z=7,stackpos=1}} local config = { empe = {x=55, y=34, z=5}, pre1 = {x=68, y=37, z=6}, pre2 = {x=42, y=37, z=6} } local tpId = 1387 local tp = { pos1 = {x=51, y=28, z=6}, pos2 = {x=59, y=28, z=6} } function removeTp(tp) local t = getTileItemById(tp.pos1, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos1, CONST_ME_POFF) end end function removeTeleport(tps) local t = getTileItemById(tp.pos2, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos2, CONST_ME_POFF) end end function onSay(cid, words, param) if param == "open" then setGlobalStorageValue(emGuerra,1) doBroadcastMessage("War of Emperium has began!",22) doSummonCreature("Emperium",config.empe,false) doSummonCreature("Emperium Guard",config.pre1,false) doSummonCreature("Emperium Guardian",config.pre2,false) addEvent(removeTp, 2*1000, tp) addEvent(removeTeleport, 2*1000, tps) return true elseif param == "close" then for _, pid in ipairs(getPlayersOnline()) do if isInArea(getPlayerPosition(pid), War.fromPos, War.toPos) then if getGlobalStorageValue(storage) ~= getPlayerGuildId(pid) then doTeleportThing(pid, War.rewardRoom, false) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE,"Sorry, your guild not win the war!") else doPlayerSendTextMessage(pid,MESSAGE_STATUS_CONSOLE_BLUE,"Your guild has domation the castle. Congratulations to help her!") end end end setGlobalStorageValue(emGuerra,0) empecreature = getThingfromPos(config.empe) if isMonster(empecreature.uid) == TRUE then doRemoveCreature(config.empe, 1) end doBroadcastMessage("The war for the castle has ended!",22) else return doPlayerSendCancel(cid,"Talk /war open[for begin the wr] or /war close[for end the war]") end return true end Editado Dezembro 30, 2011 por 139 Link para o comentário https://xtibia.com/forum/topic/176689-remover-monstro/#findComment-1164789 Compartilhar em outros sites More sharing options...
Menoxcide 3 Postado Dezembro 30, 2011 Autor Share Postado Dezembro 30, 2011 agr nao ta dando nenhum erro no distro só q tb nao ta removendo o bixo aoskksaooksakoas Link para o comentário https://xtibia.com/forum/topic/176689-remover-monstro/#findComment-1164834 Compartilhar em outros sites More sharing options...
jhon992 371 Postado Dezembro 31, 2011 Share Postado Dezembro 31, 2011 Assim é pra funcionar: local storage = 1755 local emGuerra = 1756 local War = { fromPos={x=1349, y=1101, z=7, stackpos=253}, toPos={x=1359, y=1111, z=0, stackpos=253}, rewardRoom = {x=518,y=840,z=7,stackpos=1}} local config = { empe = {x=55, y=34, z=5}, pre1 = {x=68, y=37, z=6}, pre2 = {x=42, y=37, z=6} } local tpId = 1387 local tp = { pos1 = {x=51, y=28, z=6}, pos2 = {x=59, y=28, z=6} } function removeTp(tp) local t = getTileItemById(tp.pos1, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos1, CONST_ME_POFF) end end function removeTeleport(tps) local t = getTileItemById(tp.pos2, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos2, CONST_ME_POFF) end end function onSay(cid, words, param) if param == "open" then setGlobalStorageValue(emGuerra,1) doBroadcastMessage("War of Emperium has began!",22) mid = doSummonCreature("Emperium",config.empe,false) doSummonCreature("Emperium Guard",config.pre1,false) doSummonCreature("Emperium Guardian",config.pre2,false) addEvent(removeTp, 2*1000, tp) addEvent(removeTeleport, 2*1000, tps) return true elseif param == "close" then for _, pid in ipairs(getPlayersOnline()) do if isInArea(getPlayerPosition(pid), War.fromPos, War.toPos) then if getGlobalStorageValue(storage) ~= getPlayerGuildId(pid) then doTeleportThing(pid, War.rewardRoom, false) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE,"Sorry, your guild not win the war!") else doPlayerSendTextMessage(pid,MESSAGE_STATUS_CONSOLE_BLUE,"Your guild has domation the castle. Congratulations to help her!") end end end setGlobalStorageValue(emGuerra,0) doRemoveCreature(mid) doBroadcastMessage("The war for the castle has ended!",22) else return doPlayerSendCancel(cid,"Talk /war open[for begin the wr] or /war close[for end the war]") end return true end Link para o comentário https://xtibia.com/forum/topic/176689-remover-monstro/#findComment-1165170 Compartilhar em outros sites More sharing options...
Menoxcide 3 Postado Dezembro 31, 2011 Autor Share Postado Dezembro 31, 2011 vo testa aque...mais pq doRemoveCreature(mid) ? Link para o comentário https://xtibia.com/forum/topic/176689-remover-monstro/#findComment-1165192 Compartilhar em outros sites More sharing options...
jhon992 371 Postado Dezembro 31, 2011 Share Postado Dezembro 31, 2011 pq "mid" vai ser o "cid" do monstro que é recebido nessa linha: mid = doSummonCreature("Emperium",config.empe,false) Link para o comentário https://xtibia.com/forum/topic/176689-remover-monstro/#findComment-1165193 Compartilhar em outros sites More sharing options...
Posts Recomendados