IVeve Posted July 14, 2021 Share Posted July 14, 2021 Hi, is there an easy way of clearing the entire inventory of the player, or would I have to go through removing every single item one by one? Link to comment Share on other sites More sharing options...
1 Cheshire Posted July 14, 2021 Share Posted July 14, 2021 I'm not sure why you'd need a way to clear the entire inventory if you want to give things a chance to be destroyed piece by piece. Those two seem likely two entirely different things. Â Anyway, if you want to have a chance of ''removing'' items entirely from the game on death it might be worth looking into the Player's Die method on the server. That should at least lead down to where items are dropped and you could add a second chance on top of the drop rate there to have them destroyed and remove them from the inventory. Link to comment Share on other sites More sharing options...
0 Cheshire Posted July 14, 2021 Share Posted July 14, 2021 I don't think there's an easy way to clear the entire inventory of a player right now. Is there a reason you need this? Link to comment Share on other sites More sharing options...
0 IVeve Posted July 14, 2021 Author Share Posted July 14, 2021 I'm making a game where just about every map has PVP enabled with equipment drops. I want to have a chance to drop each item (got that sorted already), but an even bigger chance to not drop the item and destroy it on respawn (my game focuses on having a player-generated economy, so having a resource sink is very important). I'm happy to edit the source, but I'd love some pointers on how to implement this, as I'm having a really hard time navigating the uncommented code. Link to comment Share on other sites More sharing options...
0 IVeve Posted July 14, 2021 Author Share Posted July 14, 2021 21 minutes ago, Cheshire said: I'm not sure why you'd need a way to clear the entire inventory if you want to give things a chance to be destroyed piece by piece. Those two seem likely two entirely different things. Â Anyway, if you want to have a chance of ''removing'' items entirely from the game on death it might be worth looking into the Player's Die method on the server. That should at least lead down to where items are dropped and you could add a second chance on top of the drop rate there to have them destroyed and remove them from the inventory. Â I want to clear the inventory, because respawn happens after death - the items that have a chance already dropped and clearing the inventory will simply remove the rest of the items. Thank you for pointing me to that function! Link to comment Share on other sites More sharing options...
Question
IVeve
Hi, is there an easy way of clearing the entire inventory of the player, or would I have to go through removing every single item one by one?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts