• 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!

TFS 1.X+ Item with actionID unpickupable to slots or container

T

Tibia Demon

Guest
How can I make an item with actionID unpickupable to both slot and container?
 
Solution
return false on event player:onMoveItem (data/events/player.lua) when item:getActionId() == yourActionId

same has to be applied to trading
return false on event player:onMoveItem (data/events/player.lua) when item:getActionId() == yourActionId

same has to be applied to trading
 
Solution
I have added it like this but I still can pick it to container and slot.
Lua:
        if (item:getActionId() == 8979) then
            self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
            return false
        end
 
Working I only had to move it under the function.
I had it in bottom of the function.
Additionally, make sure the player can't trade the item with another player.

and if the item has a 'use with' option, make sure that the player can't 'use with' something in the distance, that forces the player to walk over to the item, have the server pick it up into their inventory, then walk to whatever distant location to attempt to use the item.
 
Additionally, make sure the player can't trade the item with another player.

and if the item has a 'use with' option, make sure that the player can't 'use with' something in the distance, that forces the player to walk over to the item, have the server pick it up into their inventory, then walk to whatever distant location to attempt to use the item.
if I remember correctly, it was patched already, though testing that won't hurt
 
Additionally, make sure the player can't trade the item with another player.

and if the item has a 'use with' option, make sure that the player can't 'use with' something in the distance, that forces the player to walk over to the item, have the server pick it up into their inventory, then walk to whatever distant location to attempt to use the item.
if I remember correctly, it was patched already, though testing that won't hurt
I had to add it to Player:eek:nTradeRequest to avoid players trading item [I tested without adding it and players were able to trade and take the item with actionID]
Where should I add it to avoid [use with]? I have just tested it with rune and players can use it.
 
What this commits supposed to do? If its to avoid trading items with actionID then it doesn't work
Because I can trade items that has actionID without any restrictions unless I added this to player.lua
Lua:
function Player:onTradeRequest(target, item)
    if item:getActionId() == BLOCK_ITEM_WITH_ACTION then
        self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
        return false
end
 
What this commits supposed to do? If its to avoid trading items with actionID then it doesn't work
Because I can trade items that has actionID without any restrictions unless I added this to player.lua
Lua:
function Player:onTradeRequest(target, item)
    if item:getActionId() == BLOCK_ITEM_WITH_ACTION then
        self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
        return false
end
Its to block items with specified aid.
 
Back
Top