Postado Agosto 19, 2021 3 anos Alguém poderia me ajudar a colocar nessa spell duas coisas? É uma spell que troca de lugar com o alvo. A primeira seria: Ao usar a spell sairia um effect tanto em mim quanto no alvo. A segunda seria: Quando eu dou target em algum monstro ao invez de trocar de lugar com ele eu me teleporto para cima dele, ou se ficar muito dificil deixa como apenas não funcionar nos monstros e somente em player. 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
Postado Agosto 19, 2021 3 anos function onCastSpell(cid, var) local target = getCreatureTarget(cid) local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z} local effects = { target = CONST_ME_POFF, user = CONST_ME_POFF -- alterar para o id do efeito } if(target > 0) then if (isMonster(target)) then doTeleportThing(cid, tPos) end doTeleportThing(target, getThingPos(cid)) doSendMagicEffect(getThingPos(cid), effects.user) doSendMagicEffect(tpos, effects.target) doTeleportThing(cid, tPos) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "selecione um alvo") end return true end
Postado Agosto 19, 2021 3 anos Autor 55 minutos atrás, So volto tarde disse: function onCastSpell(cid, var) local target = getCreatureTarget(cid) local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z} local effects = { target = CONST_ME_POFF, user = CONST_ME_POFF -- alterar para o id do efeito } if(target > 0) then if (isMonster(target)) then doTeleportThing(cid, tPos) end doTeleportThing(target, getThingPos(cid)) doSendMagicEffect(getThingPos(cid), effects.user) doSendMagicEffect(tpos, effects.target) doTeleportThing(cid, tPos) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "selecione um alvo") end return true end Coloquei aqui mas não funcionou no player, no monstro ele deu certo mas o player ele só puxou o target mas não trocou de lugar com ele e deu esse erro na distro [18:20:13.727] [Error - Spell Interface] [18:20:13.729] data/spells/scripts/sasuke/rinnegan shunshin.lua:onCastSpell [18:20:13.729] Description: [18:20:13.730] attempt to index a nil value [18:20:13.730] stack traceback: [18:20:13.731] [C]: in function 'doSendMagicEffect' [18:20:13.731] data/spells/scripts/sasuke/rinnegan shunshin.lua:19: in function <data/spells/scripts/sasuke/rinnegan shunshin.lua:1> Editado Agosto 19, 2021 3 anos por Nother (veja o histórico de edições)
Postado Agosto 19, 2021 3 anos 1 hora atrás, Nother disse: Coloquei aqui mas não funcionou no player, no monstro ele deu certo mas o player ele só puxou o target mas não trocou de lugar com ele e deu esse erro na distro [18:20:13.727] [Error - Spell Interface] [18:20:13.729] data/spells/scripts/sasuke/rinnegan shunshin.lua:onCastSpell [18:20:13.729] Description: [18:20:13.730] attempt to index a nil value [18:20:13.730] stack traceback: [18:20:13.731] [C]: in function 'doSendMagicEffect' [18:20:13.731] data/spells/scripts/sasuke/rinnegan shunshin.lua:19: in function <data/spells/scripts/sasuke/rinnegan shunshin.lua:1> function onCastSpell(cid, var) local target = getCreatureTarget(cid) local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z} local effects = { target = CONST_ME_POFF, user = CONST_ME_POFF -- alterar para o id do efeito } if(target > 0) then if (isMonster(target)) then doTeleportThing(cid, tPos) end doSendMagicEffect(getThingPos(cid), effects.user) doSendMagicEffect(getThingPos(target), effects.target) doTeleportThing(target, getThingPos(cid)) doTeleportThing(cid, tPos) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "selecione um alvo") end return true end
Postado Agosto 19, 2021 3 anos Autor 7 minutos atrás, So volto tarde disse: function onCastSpell(cid, var) local target = getCreatureTarget(cid) local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z} local effects = { target = CONST_ME_POFF, user = CONST_ME_POFF -- alterar para o id do efeito } if(target > 0) then if (isMonster(target)) then doTeleportThing(cid, tPos) end doSendMagicEffect(getThingPos(cid), effects.user) doSendMagicEffect(getThingPos(target), effects.target) doTeleportThing(target, getThingPos(cid)) doTeleportThing(cid, tPos) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "selecione um alvo") end return true end Dessa vez deu certinho e não deu nenhum erro na distro, o unico problema é que não está saindo o effect que eu adcionei.
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.