Lock/prevent player from moving items?Solved
How do i make it so players cannot move an item like lock it, ive seen it done before on other servers and it puts a checker pattern over the item, is this a hook? or item property
.inventory.SetLocked(true) lock all items in inveotory,

Change there capacity.
player.inventory.containerMain.capacity = 12;​


There is also hooks to stop players from moving items.
https://umod.org/documentation/games/rust

Lock a slot.

Item c = target.inventory.containerBelt.GetSlot(2);
                      c.LockUnlock(false, target);
thank you very much

Merged post

I get this error

No overload for method `LockUnlock' takes `2' arguments
Delete the second argument.  It only takes true/false.
that dosent work, but no error message

Mpt sure if this locks the item or the slot itself.

Item c = target.inventory.containerBelt.GetSlot(2);
                      c.LockUnlock(false, target);
JCGWE
that dosent work, but no error message
I've never actually tried locking a single item.  Locking a container definitely works.

yourContainer.SetLocked(true);​
ye locking a container works but i need to know how to lock an item/slot
JCGWE
ye locking a container works but i need to know how to lock an item/slot

You can't lock specific slot. You can decreace capacity of container or  lock container. But you can't lock slot, only item

well than how do ya lock an item
If you want to lock a specific item, but not the whole container, it gets more complex.  Need to use OnItemRemovedFromContainer, OnItemSplit, and CanMoveItem hooks.
Locked automatically