So I have this apple in my game (it’s a text) and I want it so that every 1 minute, there is a 10% chance of it spawning.
And at 10 minutes, it’s guaranteed to spawn. (if it hasn’t already)
I also would like this to be a global thing, so everyone can see it.
(I want it to repeat over and over until game end)
If you can help, that would be greatly appreciated.
-Average
Here’s how:
First, grab a trigger and a lifecycle. The lifecycle (set to game start) triggers the trigger. This trigger has a 1 second delay, and when triggered, it broadcasts to itself to trigger again, making a trigger loop. Now, when this trigger is triggered, it should wire to a counter, and increment it.
This counter has a target of 60, every 60, it broadcasts to a text device. The counter also resets itself after hitting that target, and increments another counter.
First, this second counter. It has a target of 10. When it reaches that, it resets itself, and broadcasts to that text device, but on a different channel.
Now for the text device. First off, all of the scope options need to be global. Now for the settings: it should just be a blank space. But it runs some block code when receiving from that first counter. It goes:
Set var [varnum] | random integer from (1) to (10)
If ((varnum) = (1)) then
Set text | apple emoji
Make sense? I hope.
Now when receiving from that second counter:
Set text | apple emoji
Now, whenever you want the apple to disappear (you didn’t specify), just run code that resets the text back to a blank space.
Hope you understood this yapping! Comment if you have any questions (and don’t forget I won’t receive any notifs, so if I take a while to respond don’t be mad :] ).
so when you mean broadcast, do you mean wire them together?
I mean a channel.
how exactly do you broadcast?
(sorry im kinda not the best at block code,and gkc coding)
In a trigger, you make it send and receive on the same channel, making a trigger loop.
Sorry, I forgot to do this as part of my daily manual-close-since-forums-aren’t-working thing.
Solution marked a while ago, no activity for at least three hours, etc etc.