Is there any way to detect if a player is right clicking on an item to move it to their inventory? I saw an old thread saying it was strictly client side but I just wanted to check again to see if it has changed since then.
The event I've been using to check is CanMoveItem but I don't really know where to start.
Solved Detecting right-click in inventory?
Discussion in 'Rust Development' started by quintee, Jun 2, 2017.
-
Wulf Community Admin
Pretty sure that is only client-side.
-
-
Code:private object CanMoveItem(Item item, PlayerInventory playerLoot, uint targetContainer, int targetSlot) { Puts("" + targetSlot); if(targetSlot == -1) { var container = playerLoot.FindContainer(targetContainer); if(container == null) { Puts("Container is null!"); } var sourcecontainer = item.GetRootContainer(); var e = ItemManager.CreateByItemID(item.info.itemid, item.amount); e.MoveToContainer(sourcecontainer, -1); //NEED TO MOVE TO PLAYER INVENTORY return true; } return null; }