Hello, i have problem when use squeeze to rope.
When use ROPE working fine, but when use squeeze and stay on ropable tile not work.
If monster stay on ropable tile, i can go up. Item Rope work fine, Squeeze no. Who can help me?
LIB ACTIONS:
Squeeze.lua
When use ROPE working fine, but when use squeeze and stay on ropable tile not work.
If monster stay on ropable tile, i can go up. Item Rope work fine, Squeeze no. Who can help me?
LIB ACTIONS:
Lua:
TOOLS = {}
TOOLS.ROPE = function(cid, item, fromPosition, itemEx, toPosition)
if(toPosition.x == CONTAINER_POSITION) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return true
end
toPosition.stackpos = STACKPOS_GROUND
errors(false)
local ground = getThingFromPos(toPosition)
errors(true)
if(isInArray(SPOTS, ground.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 canOnlyRopePlayers = getBooleanFromString(getConfigValue('canOnlyRopePlayers'))
local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
if(canOnlyRopePlayers) then
if(isPlayer(hole.uid) and (not isPlayerGhost(hole.uid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(hole.uid))) then
doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
else
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
end
return true
end
return false
end
Squeeze.lua
Code:
local config = {
functions = {
[10511] = { -- sneaky stabber of eliteness
TOOLS.ROPE,
TOOLS.SHOVEL,
TOOLS.PICK,
TOOLS.MACHETE,
TOOLS.KNIFE
},
[10513] = { -- squeezing gear of girlpower
TOOLS.ROPE,
TOOLS.SHOVEL,
TOOLS.PICK,
TOOLS.MACHETE,
TOOLS.SCYTHE
},
[10515] = { -- whacking driller of fate
TOOLS.ROPE,
TOOLS.SHOVEL,
TOOLS.PICK,
TOOLS.MACHETE,
TOOLS.KNIFE
}
},
jamChance = 10
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local funcs = config.functions[item.itemid]
if(funcs == nil) then
return false
end
local result = false
for _, func in ipairs(funcs) do
if(func(cid, item, fromPosition, itemEx, toPosition)) then
result = true
break
end
end
if(not result) then
return false
end
if(math.random(1, 100) <= config.jamChance) then
doTransformItem(item.uid, item.itemid + 1)
doDecayItem(item.uid)
end
return true
end