Verse Library verse

01 Fragment

Automatically revives downed players when friendly teammates are nearby, suitable for co-op survival modes.

verse-library/using-down-but-not-out-devices-in-fortnite-creative/01-fragment.verse

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

# This is our main script. It lives on a device.
class RescueScript is VerseSimActor():
    # This is a list of all players in the game.
    # We call this a "Player List".
    Players := []

    # This function runs when the game starts.
    Initialize():
        # Get all players currently in the game.
        Players := GetPlayers()

    # This function runs every single frame.
    # A frame is one tiny moment in time.
    Tick():
        # We look at each player one by one.
        for Player in Players:
            # Check if this player is currently downed.
            if Player.IsDowned():
                # Find other players nearby.
                NearbyPlayers := GetPlayersNearby(Player, 5.0)
                
                # Look at each nearby player.
                for Friend in NearbyPlayers:
                    # If the friend is not downed themselves,
                    # we can revive the first player!
                    if not Friend.IsDowned():
                        # Heal the downed player to full health.

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