Hello !
I want to control if a player take off a wearable item.
Is it possible to do that otherwise that constantly look if the container.wear decrement ?
I'm look for something like a "CanWearItem(PlayerInventory inventory, Item item)" hooks reversed.
If anyone had a solution please share.
Thanks.
Controlling if player can remove an item?
Discussion in 'Rust Development' started by HUON, May 11, 2016.
-
Check out the hook OnItemRemovedFromContainer, from there you can check if the container is equal to the player's containerWear.
-
Thank you ! Very usefull !
-
No problem. If you haven't figured it out yet, the best way to move the item (as far as I've found) back is to use a NextTick then use Item.MoveContainer(player.inventory.containerWear);
You may want to use a if though, if somehow it fails to move it, it might cause an error, not sure.
