Block need help with code

So I’m making a game where you need a certain number to win Money but I want to add a feature where if a person does win then their name would be broadcast saying that they won using code

Here is a image on what I have

so you want a notification saying that they won?

Yes

have it a property set to instead of variable (“a”) and make it so you have a trigger loop (repeater) go to checker which checks if cash = property “a” then broadcast “end game” end game (device) ends game on that but a end game wiggit is set to property “NameofWinner” which trigger has receive on “End game” and has block code set property “NameofWinner” triggering players name.

Are you saying you’re making a… a… shudder
Gambling mechanic?

Nvm, change the “if” to

variable "winning number = (number here)

and the do is activity feed item → “You won the lottery!”

2 Likes

The second random integer needs to be from 0 to 1, not from 1 to 0.

2 Likes

Hang on the top of the code will be randomized from 1-10 this also represents the Winning number this broadcast to a channel to show a counter what that number is the next couple codes is the machine choosing a number if the number is correct then how am I supposed to broadcast the name of the winner

I didn’t say to change that…

Use activity feeds.

So basically the winning number would be randomized and the choosing would be randomized as well so a 1/20 chance of winning

You said change this to a specific number

The “if” part of the if block…
Screenshot 2024-10-21 5.23.06 PM
There is no 0, so if the number is chosen, and the 0 is chosen as the next variable, then they don’t get it. It feels like a cheat (even if the players don’t see).

I Meant to put 10 there

1 Like

I already explained…

Did you not see it or do you need pictures?

Well I know that’s a problem and I alr fixed it But I need a solution to the problem I asked

I did not mean to reply to you it was by accident

Now I changed the problem a bit but I am still with the name that is supposed to pop up when winning How am I supposed to show the name on a " " box
Screenshot 2024-10-21 4.22.28 PM

Use the “triggering player’s name” block…

But that block you can’t attach anything to it

I need it to say the players name and that they won