API Reference
Satchel is a reskin of the default BackpackGui located in CoreGui. Satchel acts very similar to the default backpack and is based on a fork on the default backpack. Behaviors between the two should remain the same with both of them managing the Backpack.
Summary¶
Attributes¶
| Attribute | Description | Default |
|---|---|---|
BackgroundColor3: Color3 |
Determines the background color of the default inventory window and slots. | [25, 27, 29] |
BackgroundTransparency: number |
Determines the background transparency of the default inventory window and slots. | 0.3 |
CornerRadius: UDim |
Determines the radius, in pixels, of the default inventory window and slots. | 0, 8 |
EquipBorderColor3: Color3 |
Determines the color of the equip border when a slot is equipped. | [255, 255, 255] |
EquipBorderSizePixel: number |
Determines the pixel width of the equip border when a slot is equipped. | 5 |
FontFace: Font |
Determines the font of the default inventory window and slots. | Builder Sans |
InsetIconPadding: boolean |
Determines whether or not the tool icon is padded in the default inventory window and slots. | True |
OutlineEquipBorder: boolean |
Determines whether or not the equip border is outline or inset when a slot is equipped. | True |
TextColor3: Color3 |
Determines the color of the text in default inventory window and slots. | [255, 255, 255] |
TextSize: number |
Determines the size of the text in the default inventory window and slots. | 14 |
TextStrokeColor3: Color3 |
Determines the color of the text stroke of text in default inventory window and slots. | [0, 0, 0] |
TextStrokeTransparency: number |
Determines the transparency of the text stroke of text in default chat window and slots. | 0.5 |
Methods¶
IsOpened(): boolean |
|---|
| Returns whether the inventory is opened or not. |
SetBackpackEnabled(enabled: boolean): void |
|---|
| Sets whether the backpack gui is enabled or disabled. |
GetBackpackEnabled(): boolean |
|---|
| Returns whether the backpack gui is enabled or disabled. |
GetStateChangedEvent(): RBXScriptSignal |
|---|
| Returns a signal that fires when the inventory is opened or closed. |
SetFavorite(tool: Tool, favorited: boolean): void |
|---|
Sets the favorite status of a tool. Only works if the tool has the CanBeFavorited attribute set to true. |
IsFavorited(tool: Tool): boolean |
|---|
| Returns whether a tool is favorited. Returns false if the tool cannot be favorited. |
GetFavoritedTools(): {Tool} |
|---|
| Returns a list of all currently favorited tools in the player's backpack and equipped character. |
Attributes¶
BackgroundColor3¶
Determines the background color of the default inventory window and slots. Changing this will update the background color for all elements excluding the search box background for visibility purposes.
BackgroundTransparency¶
Determines the background transparency of the default inventory window and slots. This will change how the hot bar looks in its locked state and the inventory background.
CornerRadius¶
Determines the radius, in pixels, of the default inventory window and slots. This will affect all elements with a visible rounded corner. The corner radius for the search bar is calculated automatically based on this value.
EquipBorderColor3¶
Determines the color of the equip border when a slot is equipped. The drag outline color of the slot will not changed by this.
EquipBorderSizePixel¶
Determines the pixel width of the equip border when a slot is equipped. This additionally controls the padding of tool icons. Default is 0.5 for a thin, modern border.
FontFace¶
Determines the font of the default inventory window and slots. This includes all text in the Satchel UI.
Bug
Rojo does not support the Font instance attribute so the it will not be synced. You may add the attribute manually if you wish to adjust the font.
InsetIconPadding¶
Determines whether or not the tool icon is padded in the default inventory window and slots. Changing this will change how the tool icon is padded in the slot or not.
OutlineEquipBorder¶
Determines whether or not the equip border is outline or inset when a slot is equipped. Changing this will make the equip border either border will outline or inset the slot.
TextColor3¶
Determines the color of the text in default inventory window and slots. This will change the color of all text.
TextSize¶
Determines the size of the text in the default inventory window and slots. This will change the text size of the tool names and will not change other text like search text, hotkey number, and gamepad hints.
TextStrokeColor3¶
Determines the color of the text stroke of text in default inventory window and slots. This will change the color of all text strokes which are visible.
TextStrokeTransparency¶
Determines the transparency of the text stroke of text in default chat window and slots. This will change all text strokes in which text strokes are visible.
Methods¶
IsOpened¶
Returns whether the inventory is opened or not.
Returns¶
| bool |
SetBackpackEnabled¶
Sets whether the backpack gui is enabled or disabled.
Code Samples¶
This code sample will disable the backpack gui.
| Disable Backpack | |
|---|---|
1 2 3 4 5 | |
Parameters¶
| enabled: bool | Whether to enable or disable the Backpack |
Returns¶
| void |
GetBackpackEnabled¶
Returns whether the backpack gui is enabled or disabled.
Code Samples¶
This code sample makes a TextButton that toggles the inventory when clicked.
| Toggle Satchel | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Returns¶
| bool |
GetStateChangedEvent¶
Returns a signal that fires when the inventory is opened or closed.
Code Samples¶
This code sample detects when the inventory is opened or closed.
| Detect Inventory State | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 | |
Returns¶
| RBXScriptSignal |
SetFavorite¶
Sets the favorite status of a tool. This method only works if the tool has the CanBeFavorited attribute set to true. Favorited items are protected from bulk operations and are automatically sorted to the top of the inventory.
Code Samples¶
This code sample marks a tool as favorited when the player picks it up.
| Auto-favorite Specific Tool | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Parameters¶
| tool: Tool | The tool to set the favorite status for |
| favorited: bool | Whether to favorite (true) or unfavorite (false) the tool |
Returns¶
| void |
IsFavorited¶
Returns whether a tool is currently favorited. Returns false if the tool cannot be favorited (doesn't have CanBeFavorited attribute set to true).
Code Samples¶
This code sample prevents selling favorited items.
| Protect Favorited Items | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
Parameters¶
| tool: Tool | The tool to check favorite status for |
Returns¶
| bool |
GetFavoritedTools¶
Returns a list of all currently favorited tools in the player's backpack and equipped on the character. Only returns tools that have CanBeFavorited set to true.
Code Samples¶
This code sample lists all favorited tools.
| List Favorited Tools | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
This code sample creates a "sell all non-favorited items" feature.
| Sell All Except Favorites | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
Returns¶
| {Tool} |
Favorites System¶
Overview¶
Satchel includes a built-in favorites system that allows players to mark important items and protect them from bulk operations. The system includes:
- Visual Indicator: A gold star (⭐) appears on favorited items in the bottom-right corner
- Auto-Sorting: Favorited items automatically sort to the top of the inventory by most recently favorited
- Favoritable Filter: A futuristic toggle switch in the Favorites Control Panel to show only favorited items
- Golden Background: Items that can be favorited have a golden/bronze background tint
- Thin Selection Border: Selected items now have a thinner (0.5px) modern border
How Players Favorite Items¶
Players can favorite items using two methods:
- Desktop: Right-click on an item in the inventory
- Mobile/Touch: Long-press (hold for 0.5 seconds) on an item
Setting Up Favoritable Items¶
By default, tools cannot be favorited unless they have the CanBeFavorited attribute set to true. This prevents favoriting of default/non-collectible items.
| Make Tool Favoritable | |
|---|---|
1 2 3 | |
| Batch Setup | |
|---|---|
1 2 3 4 5 6 7 8 | |
Integration Example¶
Here's a complete example showing how to integrate the favorites system into a selling script:
| Complete Sell System with Favorites | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
Persistence Across Sessions¶
Favorites can optionally persist across game sessions using Roblox DataStore. This feature is implemented using a server-side script and a JSON model for RemoteEvents.
Architecture¶
The persistence system uses:
- BackpackFavorites.model.json - Defines the RemoteEvent and RemoteFunction in ReplicatedStorage
- ServerFavorites.server.luau - Server script that handles DataStore operations
- Client-side integration - Automatically syncs favorites with the server
1 2 3 4 | |
Setup Instructions¶
1. Project Structure
The persistence files should be organized in your Rojo project:
1 2 3 4 | |
2. Rojo Configuration
Add the BackpackFavorites model to your develop.project.json:
1 2 3 4 5 6 7 8 9 | |
3. Enable DataStore
Ensure DataStoreService is enabled in your game settings:
- In Roblox Studio, go to Home → Game Settings → Security
- Enable "Enable Studio Access to API Services"
How It Works¶
On Player Join:
- Server loads favorites from DataStore
- Client requests favorites from server via RemoteFunction
- Favorites are applied to tools in the backpack
On Favorite Toggle:
- Client updates local favorite status
- Client sends update to server via RemoteEvent
- Server immediately saves to DataStore
On Player Leave:
- Server saves final favorites to DataStore
- Cache is cleared
Data Structure¶
Favorites are stored per-player using the key "Player_" .. userId:
1 2 3 4 5 6 | |
Error Handling¶
The system includes graceful degradation:
- If DataStore fails, favorites still work client-side during the session
- All DataStore operations use
pcallfor error handling - Warning messages are logged to the server console
Tip
Persistence is completely optional. Without the server-side components, the favorites system will still function normally but favorites won't persist after the player leaves.