armyman
Member
- Joined
- Feb 15, 2014
- Messages
- 318
- Reaction score
- 14
I can't rope objects,creatures,players on sewer grate, my rope don't work there.
Imgur: The most awesome images on the Internet the sewer grate id is 430, i'm using this on my script, but don't work my rope.
This is my script.
up
Imgur: The most awesome images on the Internet the sewer grate id is 430, i'm using this on my script, but don't work my rope.
This is my script.
LUA:
local OPENED_HOLE = {294, 383, 469, 470, 482, 482, 485, 489}
local OPENED_TRAP = {462}
local DOWN_LADDER = {369, 370, 408, 409, 427, 428, 3135, 3136, 5545, 5763, 435, 430}
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)
blockingItem = getThingfromPos({x = topos.x, y = topos.y, z = topos.z, stackpos = 1})
if(isInArray(ROPE_SPOT, groundItem.itemid) == TRUE) then
newPos.y = newPos.y + 1
newPos.z = newPos.z - 1
if((blockingItem.itemid > 0 and not isInArray(allowed_items_inway, blockingItem.itemid)) or isCreature(groundItem.uid)) then
doPlayerSendCancel(cid, "Sorry, not possible.")
else
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
end
return true
end
up
Last edited by a moderator: