Fortera Global
Intermediate OT User
- Joined
- Nov 20, 2015
- Messages
- 1,180
- Solutions
- 2
- Reaction score
- 117
I want to prevent players from placing items when the backpack reaches 5 full slots, this script works to some extent, to cheat is just the player to open the backpack that is inside the other and move the item there, like getTopParent() no working.
tried onMove;
TFS 1.2
tried onMove;
Lua:
local containerIdDP = toPosition.y - 64
local containerDP = self:getContainerById(containerIdDP)
if containerDP then
local ItemDEE = containerDP:getTopParent()
if ItemDEE and containerDP:getItemHoldingCount() >= 5 then
self:sendCancelMessage("NOT POSSIBLE")
self:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
end
TFS 1.2