How I can make some sort of "signal" from module script? (hard to describe in title)

Hello guys. I’m trying to make some sort of 3-in-row styled game. I decided to use 3 diffirent modules for it: GameController, ScoreController, and VisualiserController. GameController is script which is used for main moves mechanics. ScoreController used for adding score and making score pop-ups. VisualiserController used for 3D background animations.
I wanted to make it so every 1.000.000 (1 million) score earned by player will give him super-bonus, which will collect all gems of same color. But, I was wondering, how I can send signal that there’s 1 million score reached to GameController, because it’s the only module which has access to array’s data out of all scripts, and only it can change gem state from “Basic” to “Destroyer”.
As stated above, I use arrays and dictionaries, and not anything related to default roblox hierarchy of objects. Everything is stored in some variables or dictionaries, because game isn’t very big. Also, I don’t want to use BindableEvents.

Try looking into bindable events

https://create.roblox.com/docs/reference/engine/classes/BindableEvent

1 Like

I forgot to mention that I want to do that without them. Just with scripts.

Maybe with like a value then which you change to have certain things in on certain milestones e.g when it says “1m” then the GameController will see the change and run the code

I prefer to use code, because it faster 10-20 times than extracting object’s value. 1m also was one of the examples of my use cases.

There are a few pure Luau implementations of signal classes that you can use. The most popular one which gained a lot of its recognition for implementing thread reuse is GoodSignal. Swing by the discussion thread for deets between implementations.

1 Like