just return false, should give the "not possible" message by default anyway, and may solve the issue
local ec = EventCallback
ec.onMoveItem = function(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder)
if item:getActionId() == 2600 then
return RETURNVALUE_NOTPOSSIBLE
end
end
ec:register()
local ec2 = EventCallback
ec2.onTradeRequest = function(self, target, item)
if item:getActionId() == 2600 then
return RETURNVALUE_NOTPOSSIBLE
end
end
ec2:register()
just return false, should give the "not possible" message by default anyway, and may solve the issue
Try putting it directly in the player event file.
Search for player: onMoveItem in events/scripts/player.lua
Just add:
LUA:if item:getActionId() == 2600 then return RETURNVALUE_NOTPOSSIBLE end
Just put the same code within the Player: onTradeRequest function, in the same fileThis is work!!! On eventcallback not working, on events/player.lua working good!
Now give me onTradeRequest please
Possible to create script who block stand on itemID?
Try putting it directly in the player event file.
Search for player: onMoveItem in events/scripts/player.lua
Just add:
LUA:if item:getActionId() == 2600 then return RETURNVALUE_NOTPOSSIBLE end
You once helped me solve this problem and so far this solution has suited me.
Only if I get some blocked item in my hand or in the shot slot I can no longer pull it out in any way.
Is it possible to do something so that an item e.g. bought in the shop does not fall into the arrow slot/hand, but into the BP?
// player:addItem(itemId[, count = 1[, canDropOnMap = true[, subType = 1[, slot = CONST_SLOT_WHEREEVER]]]])
// player:addItemEx(item[, canDropOnMap = false[, index = INDEX_WHEREEVER[, flags = 0]]])
// player:addItemEx(item[, canDropOnMap = true[, slot = CONST_SLOT_WHEREEVER]])