Verse Library verse

01 Device

Runs a continuous loop that automatically enables and respawns shooting range targets every second.

verse-library/building-your-first-island-in-fortnite-creative/01-device.verse

# This is a comment. It explains the code.
# We are making a script for our game.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

# This is our main class. It holds our game logic.
MyGameScript := class(creative_device):

    # Wire up your shooting_range_target_devices in the UEFN Details panel,
    # one entry per dummy you place on the island.
    @editable
    Targets : []shooting_range_target_device = array{}

    # This function runs when the game starts.
    OnBegin<override>()<suspends> : void =
        # We tell the system to wait a little bit.
        # This helps everything load properly.
        Sleep(2.0)

        # Now we start the game loop.
        StartGameLoop()

    # This function runs over and over again.
    StartGameLoop()<suspends> : void =
        loop:
            # Wait for one second.
            Sleep(1.0)

            # Check each target.

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