Fabi Marzan
Well-Known Member
- Joined
- Aug 31, 2020
- Messages
- 136
- Solutions
- 6
- Reaction score
- 67
Greetings, I was trying to make a function that objects cannot be thrown in the deposit while outside an SQM.
I have the scripts but it doesn't work for me.
A picture of context:
I have the scripts but it doesn't work for me.
Lua:
function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
local depotIds = {2589, 2590, 2591}
local positionUnderDepot = {
Position(positionPlayer.x, positionPlayer.y, positionPlayer.z), -- SQM DEPOT
}
local depotLocked = true
if depotLocked and isInArray(depotIds, depotBlock) and isInArray(positionUnderDepot, fromPosition) then
local depotBlock = Tile(toPosition):getTopDownItem():getItemById()
self:sendCancelMessage("You can't throw items inside the depot while outside.")
return false
end
return true
end
A picture of context: