Verse Library verse

01 Standalone

Tracks switch activation states to increment a score and open a door when all are active.

verse-library/state/01-standalone.verse

# This script checks if the switches are in the right order.
using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/SimulatedSystem }

# We create a new script. This is our game logic.
MyPuzzleScript := class(script):

    # These are our switches. We connect them to the devices in the editor.
    Switch1: SwitchDevice
    Switch2: SwitchDevice
    Switch3: SwitchDevice
    Door: PropMoverDevice

    # This variable remembers the current state.
    # Think of it as a score counter.
    CurrentScore: int = 0

    # This function runs when you enter the CheckZone.
    CheckOrder := function(): void =
        # We check the state of each switch.
        # Is Switch 1 ON?
        if Switch1.GetState() == true:
            # If yes, we add 1 to our score.
            CurrentScore = CurrentScore + 1

        # Is Switch 2 ON?
        if Switch2.GetState() == true:
            # We add another 1 to the score.
            CurrentScore = CurrentScore + 1

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

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