Verse Library verse

01 Device

Provides continuous health regeneration to players standing inside a designated zone.

verse-library/using-healing-items-in-fortnite-creative/01-device.verse

# Import the core Verse libraries
using /Fortnite.com/Devices
using /Fortnite.com/Characters
using /Fortnite.com/FortPlayerUtilities
using /UnrealEngine.com/Temporary/Diagnostics

# This is our main device. It's the "Brain" of our healing zone.
# It sits in the world and waits for players to touch it.
med_mist_device := class(creative_device):

    # 'TriggerDevice' is the trigger_device placed in the world.
    # Wire this up in the UEFN editor by selecting your Trigger Volume.
    @editable
    TriggerDevice : trigger_device = trigger_device{}

    # 'Health_Per_Tick' is a CONSTANT.
    # It's like setting the dial on a heater. You set it once in the editor,
    # and it doesn't change during the game.
    @editable
    Health_Per_Tick : float = 10.0

    # 'Is_Healing' is a VARIABLE (specifically a mutable boolean).
    # It's like a light switch: true (on) or false (off).
    # We use this to track if anyone is currently standing in the mist.
    var Is_Healing : logic = false

    # 'CurrentPlayer' holds a reference to whoever walked into the zone.
    # option(player) means it might be empty (no one inside yet).
    var CurrentPlayer : ?player = false

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