local ec = EventCallback
ec.onMoveItem = function(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder)
if item:getActionId() == 9999 then
return RETURNVALUE_NOTPOSSIBLE
end
return true
end
ec:register()
local ec = EventCallback
ec.onTradeRequest = function(self, target, item)
if item:getActionId() == 9999 then
return RETURNVALUE_NOTPOSSIBLE
end
return true
end
ec:register()
you can just create a simple script which blocks people from moving items
here something like this:
Lua:local ids = {9999, 6000} local ec = EventCallback ec.onMoveItem = function(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder) if table.contains(ids, item:getActionId()) then self:sendTextMessage(MESSAGE_STATUS_DEFAULT, 'Sorry but you can not move this object.') return false end return true end ec:register() local ids = {9999, 6000} local ec = EventCallback ec.onTradeRequest = function(self, target, item) if table.contains(ids, item:getActionId()) then self:sendTextMessage(MESSAGE_STATUS_DEFAULT, 'Sorry but you can not move this object.') return false end return true end ec:register()
ActionID on item 9999
Idk where else u must block it to make sure people can not take it somehow
I added on Trade Request aswell so they can not take the item by trading
or use 8047 id
Lua:local ids = {9999, 6000} local ec = EventCallback ec.onMoveItem = function(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder) if table.contains(ids, item:getActionId()) then self:sendTextMessage(MESSAGE_STATUS_DEFAULT, 'Sorry but you can not move this object.') return RETURNVALUE_NOERROR end return true end ec:register() local ids = {9999, 6000} local ec = EventCallback ec.onTradeRequest = function(self, target, item) if table.contains(ids, item:getActionId()) then self:sendTextMessage(MESSAGE_STATUS_DEFAULT, 'Sorry but you can not move this object.') return RETURNVALUE_NOERROR end return true end ec:register()
Make sure u enabled onMoveItem in events.xml aswell
if that doesn't work then idk
TFS Team does some changes which are not required and makes really hard to help at a point since everything is working different but everything looks the same at that point
first post contains the answer
first post contains the answer
No have error in console.No but used it on 1.4 and 1.5 so it should work for you aswell.
Do u have any errors?
NOT WORKING.edited my last post try again
Take a clear look on rme if you even saved and change this :
toLua:ec.onMoveItem = function(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder) if table.contains(ids, item:getActionId()) then self:sendTextMessage(MESSAGE_STATUS_DEFAULT, 'Sorry but you can not move this object.') return RETURNVALUE_NOERROR end return RETURNVALUE_NOERROR end
Lua:ec.onMoveItem = function(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder) if table.contains(ids, item:getActionId()) then print(1) self:sendTextMessage(MESSAGE_STATUS_DEFAULT, 'Sorry but you can not move this object.') print(2) return RETURNVALUE_NOERROR end print(3) return RETURNVALUE_NOERROR end
restart server and show me what it says in console
english ?
Sorry I edited last post.
No errors, not workingcan u try the script on first post
I have edited it
This time it should work
function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
if hasEventCallback(EVENT_CALLBACK_ONMOVEITEM) then
return EventCallback(EVENT_CALLBACK_ONMOVEITEM, self, item, count, fromPosition, toPosition, fromCylinder, toCylinder)
end
return RETURNVALUE_NOERROR
end