My question seems to be a duplicate, but isn't, as a separate question has arisen. I know that I can use Tool:Destroy()
However, I only realised the issue as soon as I added a new tool. I have tool A, tool B, tool C, and tool D. If I delete tool 3, the issue is, then it will display as 1 tool A, 2 tool B, 4 Tool D. If I delete the third tool, then pressing 4 will still activate the fourth tool, pressing 3 will do nothing. So if I delete the tool, it goes 1, 2, 4. It seems deleting tools will not shift the hotbar numbers of subsequent tools accordingly. How can I fix this?
Removing tools from the backpack will not shift them, no. As for how to do so, not sure on all the ins and outs of the player backpack but moving the tool out of the backpack then back into it will automatically shift it to the first available slot. There may be a cleaner way of doing this but I haven't really seen a way to just reassign the slot a tool belongs to outside of just creating your own backpack.
Tool:Destroy() local Items = Player.Backpack:GetChildren() for i, Child in ipairs(Items) do Child.Parent = nil Child.Parent = Player.Backpack end