Hello!
This post is old and I was newer to programming at the time. There are much better modules out there like LemonSignal. Best of Luck!
Original Post
Hello programmers!
I’ve decided to make a module that allows you to create your own events!
All you have to do is follow these steps:
Require the module and store it in a variable named “Events”.
Make a new variable and set it to Events.new()
Call :Connect() to make a connection to your event.
Call :Invoke(…) on your event to invoke it.
Disconnect your connection by calling :Disconnect() on your connection to avoid memory leaks.
You can get the module here .
2 Likes
regexman
(reg)
January 9, 2022, 2:33pm
#2
Sorry to be that guy, but you can already use bindableevents.
3 Likes
Oh yeah. Dang it! I made this for no reason
1 Like
regexman
(reg)
January 9, 2022, 2:36pm
#4
Well, the only good thing in the module is :disconnect() so uh you didn’t make this for no reason
2 Likes
When you connect a event, it returns a RBXScriptConnection which has a :Disconnect()
function already
3 Likes
Artoshia
(Artoshia)
January 9, 2022, 3:17pm
#6
While this is true, it is important to remember that it is an instance. So depending on the implementation of the OP it may be better on memory and faster when executing.
4 Likes
regexman
(reg)
January 9, 2022, 4:07pm
#7
I can’t view source code right now, so I’ll check later.
That seems like a good time! It’s nice that you can create an event that will fire whenever a specific data value changes.
1 Like
vrs2210
(vrs2210)
January 11, 2022, 3:45pm
#9
If you’re referring to local values, then yeah it’s darn good for that, but if you’re referring to attributes, value objects, etc, then you can already do that without this.
2 Likes