📚 Hooks System
Event-driven customization for the client. Hooks allow you to customize UI behavior, add sound effects, trigger analytics, and more - without modifying core code.
Hook Manager
Core API for registering and firing hooks.
→Available Hooks
Complete reference of all hook events.
→Practical Examples
Common use cases and code samples.
→How Hooks Work
Understanding the hook system
1. Register
Register callback functions for specific events
Hooks:Register("OnSlotClick", callback)
2. Fire
When an event occurs, hooks fire with data
Hooks:Fire("OnSlotClick", slotType, index)
3. Execute
All registered callbacks run with event data
callback(slotType, index, uuid)
Why Use Hooks?
Benefits over direct modification
Non-Invasive
Don't modify core code. Safe from merge conflicts when updating.
Dynamic
Load different hooks based on UI skin or game mode.
Modular
Organize hooks into presets. Mix and match as needed.
Performant
Lightweight. Only registered callbacks execute.
Common Use Cases
What hooks are typically used for
🔊 Sound Effects
Play click, hover, and drag sounds on inventory interactions.
📷 Visual Feedback
Animate slots on hover, selection, and equip.
📊 Analytics
Track item pickups, drops, and equips for gameplay metrics.
🔮 Game Integration
Trigger achievements, quests, or other systems on events.
🎯 Haptic Feedback
Controller vibration on gamepad interactions.
🕑 Cooldowns
Debounce rapid clicks or prevent spam actions.
Quick Start
Register your first hook
-- Get the HookManager from client
local Client = require(path.to.StowayClient)
-- Register a hook
Client.Hooks:Register("OnSlotClick", function(slotType, index, uuid)
-- Play sound
SoundService.Click:Play()
-- Log for analytics
print("Clicked " .. slotType .. " #" .. index)
end)
Related Documentation
See also