Verse Library verse

02 Fragment

Initializes a new player's score to zero in a tracking map upon joining.

verse-library/4-tracking-players-using-maps/02-fragment.verse

# This function runs when a player joins
OnPlayerJoined: func(player: player) void:
    # Check if this player is already in our map (just in case)
    if (not PlayerScoreMap.Contains(player)):
        # Set the player's score to 0
        PlayerScoreMap[player] = 0

Comments

    Sign in to vote, comment, or suggest an edit. Sign in