I am working on a simple Loadout plugin for my server and everything is going well apart from the containerBelt.
Above is the line of code being used it works for the first 5 items then the 6th one just does not get added to the player.Code:item.MoveToContainer(player.inventory.containerBelt, -1, true);
Any help would be much appreciated.
Can't get an item in the 6th belt slot
Discussion in 'Rust Development' started by Deadbeat, Sep 8, 2017.
-
After further looking into this it seems the containerBelt is full after adding 5 items but it should be able to have 6.
Once in game you can place something in the empty slot.
Code:player.inventory.Strip();//Imagine for loop adding six items with the line below item.MoveToContainer(player.inventory.containerBelt, -1, true);
-
Wulf Community Admin
Are you starting with 0 or 1? -
Solved,
For some reason player.inventory.strip() was leaving a ghost item of the rock or something.
Used the lines below instead of player.inventory.strip()
Code:player.inventory.containerBelt.GetSlot(0).RemoveFromContainer(); player.inventory.containerBelt.GetSlot(1).RemoveFromContainer();