Verse Library verse

03 Write Verse Code

Awards points, sets score values, and ensures the timer starts when adjusting scores.

extracted-snippets/documentation/fortnite/verse-start-02-timer-system-in-fortnite/03-write-verse-code.verse

# Source URL: https://dev.epicgames.com/documentation/fortnite/verse-start-02-timer-system-in-fortnite
# Local doc:  epic-docs/documentation/fortnite/verse-start-02-timer-system-in-fortnite.md
# Section:    Write Verse Code
# Adjusts the player's score by the provided value.
AdjustScore(Value:int):void=
<# --- New Code Start --- #>
# Start the timer if it hasn't started yet.
if (not IsTimerStarted?):
StartTimer()
<# --- New Code End --- #>
# Sets the score award to the base value of the target.
ScoreManager.SetScoreAward(Value)
# Gets the first player in the playspace.
if (Player:player = GetPlayspace().GetPlayers()[0]):
# Awards the points to the player.
ScoreManager.Activate(Player)

Comments

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