Trigger Functions!

Intro

So, say you have the two properties “x” and “y” and you want to set “z” to the product of “x” and “y.” Well, you would use block code, simple right? Well, when you start having to do the same thing OVER AND OVER, again and again, it starts getting pretty boring. But, I am here to help you streamline this process into something quite simple I like to call: Trigger Functions!

The Guide


Materials Needed
  • One Trigger
  • At least a little block coding experience

Step 1

Place down your trigger and give it whatever function (block code) you want. In my example, it will set “z” to “x” times “y.”

Screenshot 2024-01-19 5.43.49 PM

Trigger Settings

Screenshot 2024-01-19 7.43.16 AM
Screenshot 2024-01-19 7.43.22 AM


Step 2

Set the “Trigger when receiving on” setting to whatever you want your function to be called. In my example, I will call it, “xy→z.”

image

And… boom! You’re done! Whenever you want to run the code, just call on the function by broadcasting on the channel you set it to.


Conclusion

My hopes are that this helps with block coding and making more complicated mechanics for games!

That’s all and thanks for reading!

4 Likes

cool beans! could we use this for other functions?

What do you mean “other functions?”

Edit: @clef?

Edit 2: Like, math functions?

Edit 3: If so, yes, yes you can.

Oh my god! This reminds me of a long forgotten guide:

1 Like

Wow. (sorry, if you’re saying I’m copying you)

Nah I’m not saying that. Almost no one knows about it. And besides, you explained it better. Remember, it was my first guide.

2 Likes