Stoway is a flexible and feature-rich inventory and hotbar system designed for Roblox experiences. It provides developers with a robust framework to manage player items, offering deep customization for various gameplay needs, from simple backpacks to complex, data-driven inventories. Please consider going to the latest release and downloading it there if you want a view at a basic set up.
Stoway aims to provide a comprehensive set of features to cover all your inventory needs.
The hotbar is designed for quick access and intuitive item management.
- ποΈ Drag & Drop UI: Seamlessly move items within the hotbar and between the hotbar and backpack.
- π Swappable Slots: Easily swap the contents of two slots by dragging one onto another.
- π Stacking: Configure items to stack, with customizable maximum stack sizes per item type or globally.
- πΎ Persistence Options (Savable):
- Always Save: Item data in hotbar slots persists through death and across sessions.
- Session/Life Specific: If disabled, hotbar can be configured to reset upon player death or when they leave the game.
βοΈ Static or Dynamic Display:- Static: A fixed number of hotbar slots are always visible.
- Dynamic: The hotbar can visually expand or shrink to only show slots that contain items.
The backpack serves as the main storage, with flexible operational modes.
- π¦ Dual Mode Operation:
Backpack Mode
: All tool instances (both hotbar and backpack items) are physically stored in the player's RobloxBackpack
instance. Stoway manages their organization and data.Inventory Mode
: Only tools equipped or on the hotbar are in the player's RobloxBackpack
instance. Other items are managed as data by Stoway on the server, allowing for larger and more abstract storage.
- βοΈ Item Limit: Set a total carrying capacity (e.g., by weight or item count) that considers items in both the hotbar and the backpack.
0
can signify an infinite limit. - ποΈ Drag & Drop UI: Intuitive drag and drop functionality within the backpack interface.
- π Hotbar <-> Backpack Swapping: Drag an item from the hotbar to a backpack slot (or vice-versa) will swap positions.
- π Sorting: Option to implement sorting functionality for the backpack based on specific categories (e.g., item type, rarity, name).
Enhance player interaction and item management with these powerful extras.
- β¨οΈ Bind Key Actions:
- Select a slot/item in the hotbar or backpack.
- Press a predefined key (e.g.,
Backspace
,Delete
,E
). - Trigger custom functions like deleting, selling, dropping, or using the item.
- β¨ Bound Visual Functions (On Select):
- Purely for cosmetics and visual feedback.
- When a slot/item is selected, automatically run a function without needing an additional key press.
- Use cases: Tweening the selected slot's color, showing a
ViewportFrame
preview of the item, displaying item stats, etc.
- π§ Droppable Items:
- Option to designate items as droppable.
- Drag a slot/item to a specific "droppable UI frame" or a droppable position on the 2d Interface.
- Dropping resets the slot to empty or removes the visual slot if the hotbar/backpack is dynamic.
- π Rarity Check & Display:
- If enabled, Stoway can check for a "Rarity" attribute on tools.
- Apply a corresponding color or visual indicator to a designated "rarity frame" or element within the item's UI display.
Setting up Stoway in your Roblox game is straightforward:
- π₯ Download: Grab the latest release from the Releases page (or clone the repository).
- π¦ Import: Import the
.rbxm
model file into Roblox Studio. - π Placement:
- Place the
StowayServer
ModuleScript (and its children likeSettings
) intoServerScriptService
(e.g.,ServerScriptService.Stoway.StowayServer
). - Place shared modules like
Types
intoReplicatedStorage
(e.g.,ReplicatedStorage.Shared.Types
). - Place the
StowayClient
ModuleScript (and its children) intoStarterPlayerScripts
(e.gStarterPlayerScripts.Stoway.StowayClient
). - Ensure any client-side UI and scripts are placed appropriately (e.g., in
StarterGui
StarterPlayerScripts
,ReplicatedStorage
).
- Place the
- βοΈ Configure: Modify the
Settings.lua
module to tailor Stoway to your game's needs (see Configuration below). - π Initialize: In a server-side script (e.g.,
ServerScriptService.GameManager
), initialize the system:-- Example: ServerScriptService/GameManager.lua require(game.ServerScriptService.Stoway.StowayServer)
Stoway's behavior is heavily controlled by the Settings.lua
module. This allows you to easily tweak functionality without digging deep into the core scripts.
-- Example snippet from Settings.lua
local Settings = {}
-- ... Types module requirement ...
Settings.HotbarSettings = {
HotbarType = Types.HotbarType.Static, -- "Static" or "Dynamic"
MaxSlots = 9
}
Settings.BackpackSettings = {
CarryingType = Types.CarryingType.Backpack, -- "Backpack" or "Inventory"
Limit = 50, -- 0 for infinite
Sorting = false -- true to enable sorting logic placeholder
}
Settings.CanStack = true
Settings.MaxStackCount = 64 -- maximum amount a item can stack to
Settings.RarityCheck = true
Settings.Droppable = true
Settings.SaveBackpackandSlotInfo = false -- Toggle data persistence
Settings.Bindkey = {
[tostring(Enum.KeyCode.Delete)] = function(slotContents)
print(player.Name .. " wants to delete:", slotContents.Properties.Type)
--[[ remember this runs on the client so if you want to delete
something then you will have to implement it on both sides
]]
end
}
Settings.BindFunction = function(slotContents, slotGuiObject)
print("Selected:", slotContents.Properties.Type)
-- think of the parameters as anything you want to pass from the frame/button selected on the client
end
return Settings
HowToRoblox - sourced a lot of core mechanics from him for backpack/hotbar.
Knineteen19 - his series helped me get a good understanding for inventory/hotbar, presistance, and stacking.
Avafe - learned about the existance of fusion and react on roblox from this custom hotbar and backpack system.