Elexonic
Well-Known Member
- Joined
- Jun 18, 2008
- Messages
- 1,920
- Reaction score
- 59
I have a problem with my rope ..
My string works well for 99% of the time .. but there are some occasions in which failure .. and do not know why.
How could figure out why the error occurs?
http://subir.cc/images/rope.png
View attachment rope.bmp
This is my script..
My string works well for 99% of the time .. but there are some occasions in which failure .. and do not know why.
How could figure out why the error occurs?
http://subir.cc/images/rope.png
View attachment rope.bmp
This is my script..
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(toPosition.x == CONTAINER_POSITION) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return true
end
toPosition.stackpos = STACKPOS_GROUND
local itemGround = getThingFromPos(toPosition)
if(isInArray(SPOTS, itemGround.itemid)) then
doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
return true
elseif(isInArray(ROPABLE, itemEx.itemid)) then
local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
if(hole.itemid > 0) then
doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
return true
end
return false
end