ED

[Pedido] Erro nesse script

Por edukf, 25 de abr. de 2016 em Scripts

[pedido]
erro
nesse
script
resolvido
8
1.3k
edukfE
25 de abril de 2016 às 02:58

Queria um tile que quando o player estiver em battle com um monstro ele nao pode passar, e que apareça uma mensagem " elimine o monstro" 

 

esse script seria esse, mais ta com erro alguém consegue arrumar?

 

 

 

function onStepOut(creature, item, position, fromPosition)     if not creature:isPlayer() then         return true     end     for _, s in pairs(Game.getSpectators(creature:getPosition(), false, false, 7, 7, 5, 5)) do         if s:isMonster() and not s:getMaster() then             creature:sendTextMessage(MESSAGE_INFO_DESCR, "Elimine o monstro primeiro.")             creature:teleportTo(fromPosition, false)             return true         end     end     return trueend
dalvorsnD
25 de abril de 2016 às 08:11

Qual o erro que ele apresenta?

edukfE
25 de abril de 2016 às 15:02

esse erro:

e como instala ele?

ou vc consegue fazer outro script pra mim? um tile que não de para passar enquanto um player estiver em battle com monstor

 

iRvVUbF.png

Editado Abril 25 por edukf

dalvorsnD
26 de abril de 2016 às 09:19

Esse script ta no codestyle do tfs 1.+

Tu ta usando em versão antiga ne? tem que adaptar ele

Fiz baseado no tfs 037, mas deve funcionar nos demais

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)     if not isPlayer(cid) then         return true     end     for _, s in pairs(getSpectators(getCreaturePosition(cid), 7, 5)) do         if isMonster(s) and not getCreatureMaster(s) then             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Elimine o monstro primeiro.")             doTeleportThing(cid, fromPosition, false)             return true         end     end     return trueend

 

edukfE
28 de abril de 2016 às 19:03

Ta dando um bug, o player fica preso no tile

DanihcvD
28 de abril de 2016 às 21:19

@edukf, tenta mudar de onStepOut pra onStepIn:

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)     if not isPlayer(cid) then         return true     end     for _, s in pairs(getSpectators(getCreaturePosition(cid), 7, 5)) do         if isMonster(s) and not getCreatureMaster(s) then             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Elimine o monstro primeiro.")             doTeleportThing(cid, fromPosition, false)             return true         end     end     return trueend

 

edukfE
01 de maio de 2016 às 12:16

Deu certo mt obrigado Rep

DanihcvD
01 de maio de 2016 às 15:18

Tópico movido para dúvidas / pedidos resolvidos.