Postado Julho 1, 2018 6 anos E ae galera blz, Então, estou com uma script de porta que você só passa se tiver X storage mas ela funciona da seguinte forma: O player passa e depois não consegue voltar, pois a script só teleporta ele para um lugar para dentro da 'sala'.Ou seja gostaria que depois que o player estivesse dentro da 'sala' quando ele der use na porta ele saia. Spoiler function onUse(cid, item, fromPosition) if getPlayerStorageValue(cid, XX) >= 1 then doTeleportThing(cid,{x = XX, y = XX, z = XX}) doSendMagicEffect(getPlayerPosition(cid), 10) else doPlayerSendCancel(cid,"Texto.") end return TRUE end Desde já obrigado!
Postado Julho 1, 2018 6 anos Cara, sou muito cru em scripts e não sei resolver efetivamente seu problema. Mas, ao menos, te darei uma ideia. Não sei se é válida ou não! Ok? E se você colocasse um "elseif"? Mais ou menos assim: function onUse(cid, item, fromPosition) if getPlayerStorageValue(cid, XX) >= 1 then doTeleportThing(cid,{x = XX, y = XX, z = XX}) doSendMagicEffect(getPlayerPosition(cid), 10) elseif getCreaturePosition (cid) == x = xx, y = xx, y= xx then --uma posição do lado de dentro da sala, em frente a porta doTeleportThing (cid, {posição para fora da sala}) else doPlayerSendCancel(cid,"Texto.") end return TRUE end Editado Julho 1, 2018 6 anos por amora murder (veja o histórico de edições) Otserver Global - Open Tibia angera.servegame.com
Postado Julho 2, 2018 6 anos Solução Se estiver usando uma Quest Door, é só botar no uniqueid dela a storage que tu quiser. Ajudei? De nada \o/ Att Rusherzin
Postado Julho 2, 2018 6 anos Autor 22 horas atrás, amora murder disse: Cara, sou muito cru em scripts e não sei resolver efetivamente seu problema. Mas, ao menos, te darei uma ideia. Não sei se é válida ou não! Ok? E se você colocasse um "elseif"? Mais ou menos assim: function onUse(cid, item, fromPosition) if getPlayerStorageValue(cid, XX) >= 1 then doTeleportThing(cid,{x = XX, y = XX, z = XX}) doSendMagicEffect(getPlayerPosition(cid), 10) elseif getCreaturePosition (cid) == x = xx, y = xx, y= xx then --uma posição do lado de dentro da sala, em frente a porta doTeleportThing (cid, {posição para fora da sala}) else doPlayerSendCancel(cid,"Texto.") end return TRUE end @amora murder Gostei da ideia, mas não funcionou =( @RusherzinEncontrei uma script sua e fiz umas adaptações e esta funcionando, muito obrigado! Se alguém precisar da script: Spoiler function onUse(cid, item, fromPosition, itemEx, toPosition) local doorPos = {x=getThingPosition(item.uid).x, y=getThingPosition(item.uid).y, z=getThingPosition(item.uid).z} local playerPos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z} local stg = 002 local canpass = 'texto se tiver a storage' local cannotpass = 'Texto se não tiver a storage.' if playerPos.x > doorPos.x and getPlayerStorageValue(cid, stg) == 002 then doTeleportThing(cid, {x= doorPos.x-1, y= doorPos.y, z= doorPos.z}) doSendMagicEffect(getPlayerPosition(cid), 10) doPlayerSendTextMessage(cid, 22, canpass) elseif playerPos.x < doorPos.x and getPlayerStorageValue(cid, stg) == 002 then doTeleportThing(cid, {x= doorPos.x+1, y= doorPos.y, z= doorPos.z}) doSendMagicEffect(getPlayerPosition(cid), 10) doPlayerSendTextMessage(cid, 22, canpass) elseif getPlayerStorageValue(cid, stg) ~= 002 then doPlayerSendTextMessage(cid, 22, cannotpass) end return TRUE end Editado Julho 2, 2018 6 anos por peterson18 (veja o histórico de edições)
Postado Julho 3, 2018 6 anos 4 hours ago, peterson18 said: @amora murder Gostei da ideia, mas não funcionou =( @RusherzinEncontrei uma script sua e fiz umas adaptações e esta funcionando, muito obrigado! Se alguém precisar da script: Hide contents function onUse(cid, item, fromPosition, itemEx, toPosition) local doorPos = {x=getThingPosition(item.uid).x, y=getThingPosition(item.uid).y, z=getThingPosition(item.uid).z} local playerPos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z} local stg = 002 local canpass = 'texto se tiver a storage' local cannotpass = 'Texto se não tiver a storage.' if playerPos.x > doorPos.x and getPlayerStorageValue(cid, stg) == 002 then doTeleportThing(cid, {x= doorPos.x-1, y= doorPos.y, z= doorPos.z}) doSendMagicEffect(getPlayerPosition(cid), 10) doPlayerSendTextMessage(cid, 22, canpass) elseif playerPos.x < doorPos.x and getPlayerStorageValue(cid, stg) == 002 then doTeleportThing(cid, {x= doorPos.x+1, y= doorPos.y, z= doorPos.z}) doSendMagicEffect(getPlayerPosition(cid), 10) doPlayerSendTextMessage(cid, 22, canpass) elseif getPlayerStorageValue(cid, stg) ~= 002 then doPlayerSendTextMessage(cid, 22, cannotpass) end return TRUE end Posso usar e item e remover? e pode passar pra siempre?? help
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.