using { /Fortnite.com/Characters } using { /Fortnite.com/Game } # This is a map type. # It links a player to an integer (a whole number). # Think of it as a list of Player -> Score. PlayerScoreMap := [player]int MyGame := class(creative_device): # This is our scoreboard! # It starts empty. Scoreboard : PlayerScoreMap = {} # This function runs when a player eliminates someone. OnElimination := func(player: player): # Check if the player is already on the scoreboard. # If not, give them a score of 0. if (Scoreboard[player] == 0): Scoreboard[player] = 0 # Add 1 to their score. # This updates the value for this player key. Scoreboard[player] = Scoreboard[player] + 1 # Print the new score to the debug console. print("Player scored! New total: ", Scoreboard[player]) # This runs when the game starts. OnBegin(sourced root: root): print("Game Started! The scoreboard is ready.")