Tiagone 26 Postado Junho 11, 2013 Share Postado Junho 11, 2013 Ai Pessoal Queria Sabe Como Que Fais Um Spells Que Puxa o Target Se Puderem Ajuda Rep+ Pra Quem Ajuda e o Server é 854 Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/ Compartilhar em outros sites More sharing options...
0 luccagomes 2 Postado Junho 11, 2013 Share Postado Junho 11, 2013 Tipo um exeta res? Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530633 Compartilhar em outros sites More sharing options...
0 Tiagone 26 Postado Junho 11, 2013 Autor Share Postado Junho 11, 2013 é assim o script que eu quero ao player fala Tendou ele puxa o player q esta no target Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530639 Compartilhar em outros sites More sharing options...
0 Skymagnum 234 Postado Junho 11, 2013 Share Postado Junho 11, 2013 function onCastSpell(cid, var) local target = getCreatureTarget(cid) if(target > 0 then) doTeleportThing(target, getThingPos(cid)) end return true end Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530641 Compartilhar em outros sites More sharing options...
0 znotewebsite 0 Postado Junho 11, 2013 Share Postado Junho 11, 2013 function onCastSpell(cid, var) local target = getCreatureTarget(cid) if(target > 0 then) doTeleportThing(target, getThingPos(cid)) end return true end Teria como fazer uma que o player troca-se de lugar com o target? Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530643 Compartilhar em outros sites More sharing options...
0 Skymagnum 234 Postado Junho 11, 2013 Share Postado Junho 11, 2013 (editado) function onCastSpell(cid, var) local target = getCreatureTarget(cid) local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z} if(target > 0) then doTeleportThing(target, getThingPos(cid)) doTeleportThing(cid, tPos) end return true end Editado Junho 11, 2013 por Skymagnum Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530648 Compartilhar em outros sites More sharing options...
0 Tiagone 26 Postado Junho 11, 2013 Autor Share Postado Junho 11, 2013 (editado) cara aki deu erro :C tem como ajuda? function onCastSpell(cid, var) local target = getCreatureTarget(cid) if(target > 0 then) doTeleportThing(target, getThingPos(cid)) end return true end Editado Junho 11, 2013 por Tiagone Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530650 Compartilhar em outros sites More sharing options...
0 Slicer 1070 Postado Junho 11, 2013 Share Postado Junho 11, 2013 if(target > 0 then) sky isso nao eh C++ if isCreature(target) then Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530651 Compartilhar em outros sites More sharing options...
0 Skymagnum 234 Postado Junho 11, 2013 Share Postado Junho 11, 2013 function onCastSpell(cid, var) local target = getCreatureTarget(cid) if(target > 0) then doTeleportThing(target, getThingPos(cid)) end return true end Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530652 Compartilhar em outros sites More sharing options...
0 Tiagone 26 Postado Junho 11, 2013 Autor Share Postado Junho 11, 2013 (editado) Funfou Certinho Podem Fecha o Topico e Rep+ pra tu Sky tem como ajuda em otra magia que , Atinge Direto No Mana? Editado Junho 11, 2013 por Tiagone Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530653 Compartilhar em outros sites More sharing options...
0 znotewebsite 0 Postado Junho 11, 2013 Share Postado Junho 11, 2013 (editado) function onCastSpell(cid, var) local target = getCreatureTarget(cid) local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z} if(target > 0) then doTeleportThing(target, getThingPos(cid)) doTeleportThing(cid, tPos) end return true end MAN merece 3 reps Mas tem como qnd trocar o player ficar com 10% de life e 10% de mana? Pq se n fica mt roubado só gastar mana pra trocar de lugar da pra trapar os outros fazer varias coisas :S (add aqui nos favoritos amanha te do teus reps) EDIT: Usei varias vezes e crashou o servidor =( apareceu esses erros [Error - Spell Interface] data/spells/scripts/changeposition.lua:onCastSpell Description: <luaGetThingPosition> Thing not found [Error - Spell Interface] data/spells/scripts/changeposition.lua:onCastSpell data/spells/scripts/changeposition.lua:4: attempt to index a boolean value stack traceback data/spells/scripts/changeposition.lua:4: in function <data/spells/scripts/changeposition.lua:1> Editado Junho 11, 2013 por znotewebsite Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530654 Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Junho 11, 2013 Share Postado Junho 11, 2013 adiciona isso: if not target then return not doPlayerSendCancel(cid, "You need a target.") end embaixo de: local target = getCreatureTarget(cid) Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530661 Compartilhar em outros sites More sharing options...
0 Skymagnum 234 Postado Junho 11, 2013 Share Postado Junho 11, 2013 Nem manjo das matematica mas acho q da certo. function onCastSpell(cid, var) local target = getCreatureTarget(cid) if not target then return not doPlayerSendCancel(cid, "You need a target.") end local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z} local hp = getCreatureHealth(cid) * 10 / 100 local mana = getCreatureMana(cid) * 10 / 100 doTeleportThing(target, getThingPos(cid)) doTeleportThing(cid, tPos) doCreatureAddHealth(cid, - getCreatureHealth(cid) - hp) doCreatureAddMana(cid, - getCreatureMana(cid) - mana) return true end Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530664 Compartilhar em outros sites More sharing options...
0 znotewebsite 0 Postado Junho 11, 2013 Share Postado Junho 11, 2013 Nem manjo das matematica mas acho q da certo. function onCastSpell(cid, var) local target = getCreatureTarget(cid) if not target then return not doPlayerSendCancel(cid, "You need a target.") end local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z} local hp = getCreatureHealth(cid) * 10 / 100 local mana = getCreatureMana(cid) * 10 / 100 doTeleportThing(target, getThingPos(cid)) doTeleportThing(cid, tPos) doCreatureAddHealth(cid, - getCreatureHealth(cid) - hp) doCreatureAddMana(cid, - getCreatureMana(cid) - mana) return true end Se eu usar a magia sem ter nenhum target da o mesmo erro antigo! E quando eu uso até funciona, só que quando eu troco de posição eu morro por Mana Drain :S Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530671 Compartilhar em outros sites More sharing options...
0 Slicer 1070 Postado Junho 11, 2013 Share Postado Junho 11, 2013 (editado) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if not isCreature(target) then doPlayerSendCancel(cid, "You need a target.") return true end local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z} local hp = getCreatureMaxHealth(cid) / 100 * 10 local mana = getCreatureMaxMana(cid) / 100 * 10 doTeleportThing(target, getThingPos(cid)) doTeleportThing(cid, tPos) doCreatureAddHealth(cid, - hp) doCreatureAddMana(cid, - mana) return true end Editado Junho 11, 2013 por Slicer Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530690 Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Junho 11, 2013 Share Postado Junho 11, 2013 (editado) eita, ta feia a coisa erhaushaue multiplicar por 10 e dividir por 100 é a mesma coisa que dividir por 10 o script do sky mata o player que usar a skill também achei que lua admitisse 0 como false e faltou o not no script do slicer, usa esse aqui: function onCastSpell(cid, var) local target = getCreatureTarget(cid) if target == 0 then return not doPlayerSendCancel(cid, "You need a target.") end if getCreatureHealth(cid) <= getCreatureMaxHealth(cid) * .1 then return not doPlayerSendCancel(cid, "You don't have enough life.") end if getCreatureMana(cid) <= getCreatureMaxMana(cid) * .1 then return not doPlayerSendCancel(cid, "You don't have enough mana.") end local tPos = getThingPos(target) doTeleportThing(target, getThingPos(cid)) doTeleportThing(cid, tPos) doCreatureAddHealth(cid, -getCreatureMaxHealth(cid) * .1) doCreatureAddMana(cid, -getCreatureMaxMana(cid) * .1) return true end o player não consegue usar a spell se não tiver mana ou hp pra pagar Editado Junho 11, 2013 por brun123 Link para o comentário https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/#findComment-1530696 Compartilhar em outros sites More sharing options...
Pergunta
Tiagone 26
Ai Pessoal Queria Sabe Como Que Fais Um Spells Que Puxa o Target Se Puderem Ajuda Rep+ Pra Quem Ajuda e o Server é 854
Link para o comentário
https://xtibia.com/forum/topic/215963-ajuda-script-spell-que-puxa-o-target/Compartilhar em outros sites
17 respostass a esta questão
Posts Recomendados