Jump to content

Swap Equipment

Recommended Posts


I published a simple mod to tweak the game's response to equipping an item.

The previously equipped item, instead of being sent to the first available slot, is swapped directly into the same slot.

This should help managing multiple hats (or weapons, but often hats) without them making a mess in your inventory.

Here is the page:


Edited by Monso06
Link to comment
Share on other sites

So the problem seems to be that I can't access "components/inventory.lua" client side, and the property item.prevslot that I need to manipulate.

Since this property doesn't seem to be defined in other lua such as "components/inventory_replica.lua" (or any other), I'm not sure how to make it work.

Anybody has an idea?

Link to comment
Share on other sites

the majority of components are available only on the server, so you would need to use a 'replica' to manipulate the inventory
for example, if you wanted to get the item in the player's hand slot, then you would use the command below:


the client doesn't seem to track the previous slot of an item, so you'd have to track it on your own by storing an item's previous slot whenever the player equips an item


Link to comment
Share on other sites

Thanks for your answer.

I can track the proper slot client side, but I'm not sure what to do with it. There's no way of updating the prevslot property from the replica.

Also, what I can't find is how to move an item to that slot manually.

It seems there's no way in the replica to move items from one slot to another, without first taking it as the active item.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...