Verse Library verse

01 Fragment

Prevents specific teams from using a teleporter during the lobby phase by checking overlap events and game state.

verse-library/all-options/01-fragment.verse

# This script attaches to a Trigger Volume.
# It acts as a bouncer at the club door.

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

# We define our Trigger as an Entity.
# In the Scene Graph, this entity has a 'OnBeginOverlapping' event.
struct MyLobbyTrap : Entity {
    # The device we want to control
    TeleporterDevice: TeleporterDevice = TeleporterDevice{}
    
    # The team that is FORBIDDEN from using this
    # If a player is on this team, they get bounced.
    BannedTeam: Team = Team{Index = 0}
    
    # This is the main "Bouncer" function.
    # It runs when a player steps on the trigger.
    OnBeginOverlapping := func(Other: Entity) -> void {
        # 1. Check if the thing stepping on us is a Player
        Player: PlayerDevice = Other.As[PlayerDevice]()
        if (Player == None) {
            return # Not a player, so let's ignore them.
        }

        # 2. Check the Phase
        # We want to block this ONLY in the Pre-Game phase.
        # If the game has started, we return early (do nothing).
        if (GetPhase() != Phase::PreGame) {
            return # Game is live. The trap is disarmed.

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