Verse Library verse

01 Device

Gives a healing apple item to players when the device activates.

verse-library/apple/01-device.verse

# This code makes an Apple heal you!
using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }
using { /Verse.org/Simulation }
using { /Verse.org/Simulation/Tags }
using { /UnrealEngine.com/Temporary/Diagnostics }

# We create a tag so we can mark objects.
# A tag is like a sticker we put on things.
player_tag := class(tag) {}

# We create a new class.
# It lives inside a Creative Device.
healing_apple_device := class(creative_device):

    # We connect this device to an item_spawner_device in the editor.
    # That device holds the Apple we want to give.
    @editable
    AppleDevice : item_spawner_device = item_spawner_device{}

    # This runs automatically when the game starts.
    OnBegin<override>()<suspends> : void =
        HealingAppleScript()

    # This function finds players and gives them an Apple.
    HealingAppleScript()<suspends> : void =
        # We find all players on the island.
        # GetPlayspace gives us the current game session.
        # GetPlayers gives us everyone in it.
        Players := GetPlayspace().GetPlayers()

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