Postado Dezembro 22, 2022 3 anos Fiz uma modificação no script, e agora precisará configurar a localização da alavanca também: local lever = { id = 10030, position = { x = 100, y = 100, z = 7 }, } local teleport = { id = 1387, position = { x = 100, y = 100, z = 7 }, gotoPosition = { x = 200, y = 200, z = 7 }, } function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == lever.id then addEvent(function() doRemoveItem(getTileItemById(teleport.position, teleport.id).uid) doTransformItem(getTileItemById(lever.position, lever.id - 1).uid, lever.id) end, 5 * 60 * 1000) doTransformItem(item.uid, lever.id - 1) doCreateTeleport(teleport.id, teleport.gotoPosition, teleport.position) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "A portal already exists.") end return true end Observação: quando a alavanca voltar a ser id 10030, talvez ficará sem o uniqueId que você configurou. Se a alavanca ficar sem o uniqueId na versão anterior do script, use esta: local lever = { id = 10030, position = { x = 100, y = 100, z = 7 }, uniqueId = 3775, } local teleport = { id = 1387, position = { x = 100, y = 100, z = 7 }, gotoPosition = { x = 200, y = 200, z = 7 }, } function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == lever.id then addEvent(function() doRemoveItem(getTileItemById(teleport.position, teleport.id).uid) tranform = doTransformItem(getTileItemById(lever.position, lever.id - 1).uid, lever.id) doItemSetAttribute(transform, "uid", lever.uniqueId) end, 5 * 60 * 1000) doTransformItem(item.uid, lever.id - 1) doCreateTeleport(teleport.id, teleport.gotoPosition, teleport.position) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "A portal already exists.") end return true end Editado Dezembro 22, 2022 3 anos por Anderson Sacani (veja o histórico de edições)
Postado Dezembro 22, 2022 3 anos Autor 1 hora atrás, Anderson Sacani disse: Fiz uma modificação no script, e agora precisará configurar a localização da alavanca também: local lever = { id = 10030, position = { x = 100, y = 100, z = 7 }, } local teleport = { id = 1387, position = { x = 100, y = 100, z = 7 }, gotoPosition = { x = 200, y = 200, z = 7 }, } function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == lever.id then addEvent(function() doRemoveItem(getTileItemById(teleport.position, teleport.id).uid) doTransformItem(getTileItemById(lever.position, lever.id - 1).uid, lever.id) end, 5 * 60 * 1000) doTransformItem(item.uid, lever.id - 1) doCreateTeleport(teleport.id, teleport.gotoPosition, teleport.position) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "A portal already exists.") end return true end Observação: quando a alavanca voltar a ser id 10030, talvez ficará sem o uniqueId que você configurou. Se a alavanca ficar sem o uniqueId na versão anterior do script, use esta: local lever = { id = 10030, position = { x = 100, y = 100, z = 7 }, uniqueId = 3775, } local teleport = { id = 1387, position = { x = 100, y = 100, z = 7 }, gotoPosition = { x = 200, y = 200, z = 7 }, } function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == lever.id then addEvent(function() doRemoveItem(getTileItemById(teleport.position, teleport.id).uid) tranform = doTransformItem(getTileItemById(lever.position, lever.id - 1).uid, lever.id) doItemSetAttribute(transform, "uid", lever.uniqueId) end, 5 * 60 * 1000) doTransformItem(item.uid, lever.id - 1) doCreateTeleport(teleport.id, teleport.gotoPosition, teleport.position) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "A portal already exists.") end return true end Ah mano o outro script tava tudo certo, eu que esqueci de por o uniqueID. Tava actionID, muito obrigado Anderson!
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.