Postado Fevereiro 8, 2023 2 anos Opa, boa tarde rapazeada do TK, o script de corda que eu tenho, dá para usa-la em qualquer situação, eu queria limitar isso, para só poder usar a corda se não tiver nada no sqm de ropar, como nas versões antigas, se um player for no sqm não da pra ropar, ou se tiver algum item, etc... rope.lua: Spoiler local OPENED_HOLE = {294, 383, 469, 470, 482, 482, 485, 489, 430} local OPENED_TRAP = {462} local DOWN_LADDER = {369, 370, 408, 409, 427, 428, 3135, 3136, 5545, 5763} local ROPE_SPOT = {384, 418} local allowed_items_inway = {2016, 2017, 2018, 2019, 2020, 2021, 1903, 1904, 1905} function onUse(cid, item, frompos, item2, topos) newPos = {x = topos.x, y = topos.y, z = topos.z, stackpos = 0} groundItem = getThingfromPos(newPos) BlockItemPos = {x = topos.x, y = topos.y, z = topos.z, stackpos = 2} blockingItem = getThingfromPos(BlockItemPos) BlockItem1 = {x = topos.x, y = topos.y, z = topos.z, stackpos = 1} blockiItem1 = getThingfromPos(BlockItem1) if (isInArray(ROPE_SPOT, groundItem.itemid) == TRUE) then newPos.y = newPos.y + 1 newPos.z = newPos.z - 1 if blockingItem.itemid <= 0 or blockiItem1.itemid <= 0 or (isInArray(allowed_items_inway, blockingItem.itemid) == TRUE) then doTeleportThing(cid, newPos) end elseif (isInArray(OPENED_HOLE, groundItem.itemid) == TRUE or isInArray(OPENED_TRAP, groundItem.itemid) == TRUE or isInArray(DOWN_LADDER, groundItem.itemid) == TRUE) then newPos.y = newPos.y + 1 downPos = {x = topos.x, y = topos.y, z = topos.z + 1, stackpos = 255} downItem = getThingfromPos(downPos) if (downItem.itemid > 0) then doTeleportThing(downItem.uid, newPos) else doPlayerSendCancel(cid, "Sorry, not possible.") end else return FALSE end return TRUE end
Postado Fevereiro 8, 2023 2 anos Autor 18 minutos atrás, Anderson Sacani disse: Qual versão do teu servidor? 1.0 até 1.0.4
Postado Fevereiro 9, 2023 2 anos Não entendi, mas se teu servidor tem suporte à revscripts usa esse script que criei um tempo atrás: local holeId = { 294, 369, 386, 370, 385, 394, 411, 412, 413, 432, 433, 435, 8709, 594, 595, 615, 609, 610, 615, 1156, 482, 483, 868, 874, 4824, 7768, 433, 432, 413, 7767, 411, 370, 369, 7737, 7755, 7768, 7767, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7762, 8144, 8690, 8709, 12203, 12961, 17239, 19220, 23364 } local ropeSpots = { 386, 421, 386, 7762, 12202, 12936, 14238, 17238, 23363, 21965, 21966, 21967, 21968 } local specialRopeSpots = { 12935 } local rope = Action() function rope.onUse(player, item, fromPosition, target, toPosition, isHotkey) newPos = { x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 0 } target = getThingfromPos(newPos) blockingItem = getThingfromPos({ x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE }) if ((isInArray(ropeSpots, target.itemid)) or (isInArray(specialRopeSpots, target.itemid))) then newPos.y = newPos.y + 1 newPos.z = newPos.z - 1 if ((blockingItem.itemid > 0) or (isCreature(target.uid) == true)) then player:sendTextMessage(MESSAGE_FAILURE, "Sorry, not possible.") else player:teleportTo(newPos) end elseif isInArray(holeId, target.itemid) then newPos.y = newPos.y + 1 downPos = { x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = 255 } downItem = getThingfromPos(downPos) if (downItem.itemid > 0) then doTeleportThing(downItem.uid, newPos) else player:sendTextMessage(MESSAGE_FAILURE, "Sorry, not possible.") end end return true end rope:id(3003, 646) rope:register()
Postado Fevereiro 9, 2023 2 anos Autor 1 hora atrás, Anderson Sacani disse: Não entendi, mas se teu servidor tem suporte à revscripts usa esse script que criei um tempo atrás: local holeId = { 294, 369, 386, 370, 385, 394, 411, 412, 413, 432, 433, 435, 8709, 594, 595, 615, 609, 610, 615, 1156, 482, 483, 868, 874, 4824, 7768, 433, 432, 413, 7767, 411, 370, 369, 7737, 7755, 7768, 7767, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7762, 8144, 8690, 8709, 12203, 12961, 17239, 19220, 23364 } local ropeSpots = { 386, 421, 386, 7762, 12202, 12936, 14238, 17238, 23363, 21965, 21966, 21967, 21968 } local specialRopeSpots = { 12935 } local rope = Action() function rope.onUse(player, item, fromPosition, target, toPosition, isHotkey) newPos = { x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 0 } target = getThingfromPos(newPos) blockingItem = getThingfromPos({ x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE }) if ((isInArray(ropeSpots, target.itemid)) or (isInArray(specialRopeSpots, target.itemid))) then newPos.y = newPos.y + 1 newPos.z = newPos.z - 1 if ((blockingItem.itemid > 0) or (isCreature(target.uid) == true)) then player:sendTextMessage(MESSAGE_FAILURE, "Sorry, not possible.") else player:teleportTo(newPos) end elseif isInArray(holeId, target.itemid) then newPos.y = newPos.y + 1 downPos = { x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = 255 } downItem = getThingfromPos(downPos) if (downItem.itemid > 0) then doTeleportThing(downItem.uid, newPos) else player:sendTextMessage(MESSAGE_FAILURE, "Sorry, not possible.") end end return true end rope:id(3003, 646) rope:register() Deu erro na distro mano, meu servidor é na versão 7.4, teria que ser desse jeito por padrão, lembra como era o script de corda nas versões antigas? não dava pra ropar se tivesse algo no sqm
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.