When I called setbar(1) it set 1 slot free and others locked. Which means that when I call getbar() it will return 1 but red area will actually start from index 2. So getbar() returns the index before the red area starts.getbar() → uint
Get the current bar. This is the index at which the red area starts.
Lua Docs Inventory.getbar - misleading description
Lua Docs Inventory.getbar - misleading description
Assuming indexes in lua start from 1.
Re: Lua Docs Inventory.getbar - misleading description
Thanks for the report. The description is correct just it was using zero-based indexing instead of lua 1-based.
To set 1 slot free you would use setbar(2) so the bar starts at the begining of slot #2. to set no slots free you would start the bar at slot 1.
I've fixed it for the next version of 0.16. so it uses 1-based indexing.
To set 1 slot free you would use setbar(2) so the bar starts at the begining of slot #2. to set no slots free you would start the bar at slot 1.
I've fixed it for the next version of 0.16. so it uses 1-based indexing.
If you want to get ahold of me I'm almost always on Discord.