[Release] BindableCore - A Clean, Type-Safe BindableEvent/BindableFunction Library
Module: BindableCore
License: MIT
Why BindableCore?
A lightweight, high-performance solution for managing BindableEvent
/BindableFunction
instances without the boilerplate. Designed for developers who like to work code-based and value:
Optimized Performance
-
Automatic instance caching β Eliminates redundant
Instance.new()
calls, reducing memory overhead. - Event pooling β Reuses existing Bindables instead of creating new ones.
Type-Safe & Debug-Friendly
- Luau type checking β Catches mismatched events/functions at edit-time with strict annotations.
-
Clear warnings β Detailed error messages for invalid usage (e.g., firing a
BindableFunction
as an event).
Zero-Dependency & Lightweight
- Under 100 lines β Minimal footprint, no external bloat.
- Works everywhere β Compatible with both client and server scripts.
Structured Event Handling
- Active listener tracking β Avoids firing events with no receivers.
Usage Examples
BindableEvent (Fire/Listen)
-- SENDER
BindableCore:Fire("PlayerHit", { player = "Player1", damage = 50 })
-- RECEIVER
BindableCore:ListenToEvent("PlayerHit"):Connect(function(data)
print(data.player, "took", data.damage, "damage!")
end)
BindableFunction (Invoke/Respond)
-- REQUESTER
local result = BindableCore:Invoke("GetPlayerLevel", "Player1")
print("Player level:", result)
-- HANDLER
BindableCore:ListenToFunction("GetPlayerLevel", function(playerName)
return game.Players[playerName].Level.Value
end)
Features
Event Caching β Reuses instances to avoid memory leaks.
Debug-Friendly β Warns on compatibility issues (e.g., using
BindableFunction
as BindableEvent
).
Cross-Side Safety β Prevents accidental client/server overlaps with prefixes.
Installation
- Paste the ModuleScript into ReplicatedStorage.
- Require it in any script:
local BindableCore = require(path.to.BindableCore)
Ideal For
Game-wide events (e.g., UI updates, gameplay triggers).
Safe inter-script communication without RemoteEvents.
Structured codebases using Luau types.
Resources
- Module: BindableCore
- RBXM: BindableCore.rbxm (2.8 KB)
Feedback Welcome!
Questions? Suggestions? Let me know below!
Credits
Developed with by @AexesDev. Licensed under MIT.