T
Tibia Demon
Guest
i had this script in data/events and was working and now don't work in events or when i try to move it to data/scripts
what i have wrong on it? tfs 1.4.2
what i have wrong on it? tfs 1.4.2
Lua:
local BLOCK_ITEM_WITH_ACTION = 8000
local blockedActions = {4373, 4374, 4375, 4376, 4377, 4378, 4379, 4340, 4342, 4344, 4355, 4361, 4363, 4364, 4366, 4367, 4368, 4369, 4370, 4380}
local ec = EventCallback
function ec.onMoveItem(player, item, count, fromPosition, toPosition, fromCylinder, toCylinder)
if item:getActionId() == BLOCK_ITEM_WITH_ACTION then
self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
return false
end
local tile = Tile(toPosition)
if tile then
local ground = tile:getGround()
if table.contains(blockedActions, ground:getActionId()) then
self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
return false
end
return true
end
end
ec:register()
Last edited by a moderator: