• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Error on player.lua With anti-stack

viking

Member
Joined
Aug 20, 2015
Messages
323
Reaction score
22
raYX1xE.png


This happens when I try to move one item to water
My script in line 104 is:

Code:
function Player:onMoveItem(item, count, fromPosition, toPosition)
        if toPosition.x == 65535 or #Tile(toPosition):getItems() <= 15 then
                return true
        end
        self:sendCancelMessage('Sorry, not possible.')
        return false
end
 
Last edited:
I would done something like this:

Code:
function Player:onMoveItem(item, count, fromPosition, toPosition)
    if toPosition.x ~= CONTAINER_POSITION then
        local tileCount = Tile(toPosition):getItemCount()
        if tileCount > 15 then
            self:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
            return false
        end
    end

    return true
end
 
I would done something like this:

Code:
function Player:onMoveItem(item, count, fromPosition, toPosition)
    if toPosition.x ~= CONTAINER_POSITION then
        local tileCount = Tile(toPosition):getItemCount()
        if tileCount > 15 then
            self:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
            return false
        end
    end

    return true
end

This work, thanks you so much bro. Rep+
 

Similar threads

Back
Top