Help ! How to check results in a dice roll with multiple players?

Hi guys !

I am currently creating a small tool to help in the card game Magic the Gathering. Before I move on to the life-point counting part, I make a small roll of dice to find out who starts. It is possible to roll the dice for 2, 3 or 4 players.

I managed to code my dice roll but when it comes to know which of the 2, 3 or 4 players is winning, that’s where it gets complicated to me.

My approach was as follows:

  • create a variable (list) which will store the results
  • sort in descending order
  • ask if the first value in my list (theoretically the winner) matches to player 1,2,3…
  • store the winner’s name in a variable and display it later in a message.

And with this code, the dice is rolling good but nothing happens after… I despair ^^
If a good soul could help me, that would be awesome !

Thank you in advance to all!
Kind regards,

p.s : here’s a picture of my code so far

Hey @samuelbaudrillartwuc

Did you ever manage to get this working in the end?

This seems like a good strategy to me, but I’d recommend using cloud variables instead of local variables.

Hope that helps!