- Home /
players chance of winning is increased based on their level.
Hi guys, I have a very challenging problem I would love some help with! I code in C#
The Players Names are stored in List Player. The Player level is List Chances. If Amy is level 7 and George is level 9, Cindy is level 4, Dave is level 2, Emily is level 5, Frank is 17.
The Game randomly shows a winner based of the new chances a player has to win, Frank should win.
Here is my example code:
using System.Collections.Generic;
using UnityEngine;
public class WhoWonGame: MonoBehaviour
{
private string winner;
List<string> Player;
List<int> Chances;
List<string> PlayerChances;
public void Start()
{
for (int j = 0; j < Player.Capacity; j++)
{
// PlayerChances = Player + Chances;
}
}
public void whoWon()
{
// winner = Random.PlayerChances;
Debug.Log(winner);
}
}
I would love the help! This might not be possible... How do I store the data to make it work? The data is collected from the client and sent to the server when a player clicks a UI button.
Your answer
![](https://koobas.hobune.stream/wayback/20220612111857im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do I make a controllable horde increase in population? 0 Answers
How to let player know they have completed a level 2 Answers
getting a variable from another script problem 1 Answer
Clean way for percentages 0 Answers
Two player collision ? 1 Answer