Skip to content

Implement BindableEvent and ConnectBindable methods#270

Open
JustBorgar wants to merge 1 commit into
Sleitnick:mainfrom
JustBorgar:patch-1
Open

Implement BindableEvent and ConnectBindable methods#270
JustBorgar wants to merge 1 commit into
Sleitnick:mainfrom
JustBorgar:patch-1

Conversation

@JustBorgar
Copy link
Copy Markdown

The signal library is great for modules, but sometimes I simply need 2 imperative scripts under the same context to talk to each other, and bindables fit that use case just fine (and avoid having to add the Signal utility as a dependancy for Net).

An example use case would be an egg in an egg hunt, where each egg has it's own behaviour but they all must communicate to the manager coordinating the eggs that it has been collected (on this case the manager is imperative as it doesn't have enough functions to justify making a module, thus signals wouldn't make a whole lot of sense).

local Bindable = Net:BindableEvent("EggManager")
local Collected = false

--...

local function Collected(Hit: BasePart)
	if not Collected then
		--...
		Collected = true

		--Request collection
		Bindable:Fire(Player, "CollectEgg", Egg)
	end
end

Alternatively a 'Name' method could be added to the signal utility that just creates and/or returns a signal from a dictionary, but 'Net' seemed more fitting imo.

@mirsdemo
Copy link
Copy Markdown

mirsdemo commented May 3, 2026

The signal library is great for modules, but sometimes I simply need 2 imperative scripts under the same context to talk to each other, and bindables fit that use case just fine (and avoid having to add the Signal utility as a dependency for Net).

I agree with you regarding the dependency footprint, though the reason we often use the Signal utility is for defensive programming, and to maintain a consistent execution structure across our projects.

Mixing C2C (context-to-context) communication patterns directly within Net could lead to an inconsistent API that's a bit harder to maintain.

I'd say best course of action is keeping this as is for now, though I think a PR for a BindableEvent wrapper that sits atop of the Net library for your specific needs would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants