Skip to content

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.

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
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

local button = Instance.new("TextButton")
button.AnchorPoint = Vector2.new(0.5, 0.5)
button.Position = UDim2.new(0.5, 0, 0.5, 0)
button.Text = "Toggle Inventory"
button.MouseButton1Click:Connect(function()
    if Satchel:GetBackpackEnabled() then
        Satchel.SetBackpackEnabled(false)
    else
        Satchel.SetBackpackEnabled(true)
    end
end)

This code sample detects when the inventory is opened or closed.

Detect Inventory State
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

Satchel.GetStateChangedEvent():Connect(function(isOpened: boolean)
    if isOpened then
        print("Inventory opened")
    else
        print("Inventory closed")
    end
end)

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.

Attributes

BackgroundColor3

Color3

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

number

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

UDim

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

Color3

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

number

Determines the pixel width of the equip border when a slot is equipped. This additionally controls the padding of tool icons.

FontFace

Enum.Font

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

bool

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

bool

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

Color3

Determines the color of the text in default inventory window and slots. This will change the color of all text.

TextSize

number

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

Color3

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

number

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.

Code Samples

This code sample will return whether the inventory is opened or not.

Is Opened
1
2
3
4
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

local isOpened = Satchel.IsOpened()

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
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

Satchel.SetBackpackEnabled(false)

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 will return whether the backpack gui is enabled or disabled.

Get Backpack Enabled
1
2
3
4
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

local isEnabled = Satchel.GetBackpackEnabled()

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
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

Satchel.GetStateChangedEvent():Connect(function(isOpened: boolean)
    if isOpened then
        print("Inventory opened")
    else
        print("Inventory closed")
    end
end)

Returns

RBXScriptSignal