Verse Library verse

06 Eliminate The Player

Shows victory messages, waits, triggers the end game device, and handles script cleanup on termination.

extracted-snippets/documentation/fortnite/verse-parkour-template-in-unreal-editor-for-fortnite/06-eliminate-the-player.verse

# Source URL: https://dev.epicgames.com/documentation/fortnite/verse-parkour-template-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/fortnite/verse-parkour-template-in-unreal-editor-for-fortnite.md
# Section:    Eliminate the player
# Asynchronous function that handles the end of the game
EndGame(Agent:agent)<suspends>:void=
    HUDMessageBattery.SetText(AllBatteriesCollectedMessage)
    HUDMessageBattery.Show(Agent)
    # Wait for three seconds before ending the game
    Sleep(3.0)
    EndGameVictoryDevice.Activate(Agent)


# Runs when this device_script is stopped or the game ends
OnEnd<override>():void=
    Logger.Print("Verse device stopped!")

Comments

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