Custom Hotbar Problem

I am coding a custom hotbar for the first time, it is proving quite difficult

I made a system where player.backpack[1] would go in the first slot, and the player.backpack[2] would go in the second slot etc etc, the problem is that I forgot that when you equip an item, it leaves backpack and goes to the player character

so when I press “1” to equip, it will equip it, but if i press it again it will equip item 2, since it became backpack[1] after backpack[1] left to go into the player

I hope it makes sense,
Do I need to remake a new system?

If you don’t want this behavior then make sure you aren’t shuffling down the table by using table.remove. Instead directly reference the slot and set it to none.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.