cant find anything at all so im asking you guys for help
is it possible to make items unmoveable in lua and without any special actionid?
is it possible to make items unmoveable in lua and without any special actionid?
if item:getId() == xxxx and fromPosition.x == xxxx and fromPosition.y == xx and fromPosition.z == xxxx then
self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
return false
end
<attribute key="moveable" value="0" />
if item:getId() == 1234 then
return false
end
Set this tag on items.xml
LUA:<attribute key="moveable" value="0" />
yes, almost everything is possible by changing the PlayernMoveItem function:
LUA:if item:getId() == 1234 then return false end
Sorry, i didn't see that you want in lua.a good solution too but is it still possible via lua?
if item:getId() == xxxx and fromPosition.x == xxxx and fromPosition.y == xx and fromPosition.z == xxxx then
self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
return false
end
Those ones will apply to all items with X-id but you can add item position so it only apply if items are on this position.
LUA:if item:getId() == xxxx and fromPosition.x == xxxx and fromPosition.y == xx and fromPosition.z == xxxx then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end
yes, almost everything is possible by changing the PlayernMoveItem function:
LUA:if item:getId() == 1234 then return false end
Those ones will apply to all items with X-id but you can add item position so it only apply if items are on this position.
LUA:if item:getId() == xxxx and fromPosition.x == xxxx and fromPosition.y == xx and fromPosition.z == xxxx then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end
<event class="Player" method="onMoveItem" enabled="1" />
How did you add it? It works, I use it on my server on many locations already.Doesnt work
return true
so it should look like thisfunction Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
if item:getId() == xxxx and fromPosition.x == xxxx and fromPosition.y == xx and fromPosition.z == xxxx then
self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
return false
end
return true
end
I came here to mention this.If the item is tradeable you should add check into it too.
Best Answer
, You have like 2 other threads left opened where we don't know if they are solved yet or unsolved or you still gonna request more help there.11. Marking "Best Answer"
- Once your problem is resolved, please MARK SOLUTION AS "BEST ANSWER".
My fault sorry@AngeLOT If you already solved your thread mark it as solved and/or mark the solution which fits you best asBest Answer
, You have like 2 other threads left opened where we don't know if they are solved yet or unsolved or you still gonna request more help there.