Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Need Help with Random Events
- Quantum1993
-
Scratcher
500+ posts
Need Help with Random Events
I'm making a spy-themed game. Every time the player presses one of the action buttons, eventually players will get a message telling them if the action was successful. If it wasn't, they might get a game over.
I know how to randomize the result, but I need help with figuring out how to broadcast the randomized result to a message icon sprite, which shows the result when clicked.
I know how to randomize the result, but I need help with figuring out how to broadcast the randomized result to a message icon sprite, which shows the result when clicked.
- scratch___user12345
-
Scratcher
1000+ posts
Need Help with Random Events
Just set a global variable to the result and then broadcast something like “Check Variable” and have the other sprite recieve it and check the variable and act on its value.
- Quantum1993
-
Scratcher
500+ posts
Need Help with Random Events
Thanks
Just set a global variable to the result and then broadcast something like “Check Variable” and have the other sprite recieve it and check the variable and act on its value..
- benche1
-
Scratcher
100+ posts
Need Help with Random Events
when I receive [ action]All messages except 1 are useless.
broadcast (pick random (1) to (chance of success))
Last edited by benche1 (Jan. 12, 2024 20:20:11)
- Quantum1993
-
Scratcher
500+ posts
Need Help with Random Events
That helps a lot!when I receive [ action]All messages except 1 are useless.
broadcast (pick random (1) to (chance of success))
- Discussion Forums
- » Help with Scripts
-
» Need Help with Random Events