false

type
false,
Module
AI
Declared in
AI
Source
fortnite

Used in

# The animation to play. You CANNOT build an animation_sequence in Verse
    # (its constructor is epic_internal) -- it's an editor-imported asset. So the
    # slot is an OPTION: pick the asset in the device's Details panel in UEFN,
    # and we unwrap it at use with `EmoteAnim?`.
    @editable
    EmoteAnim : ?animation_sequence = false

    # Press to play the animation on the presser's character.
    @editable
    PlayButton : button_device = button_device{}

    # Press to stop the most recent playback.
    @editable
    StopButton : button_device = button_device{}

    # Remember the latest instance so the Stop button can cancel it.
    var CurrentAnim : ?play_animation_instance = false

    OnBegin<override>()<suspends> : void =
        PlayButton.InteractedWithEvent.Subscribe(OnPlayPressed)
        StopButton.InteractedWithEvent.Subscribe(OnStopPressed)

    # GetFortCharacter and GetPlayAnimationController both <decide>, so they go
    # in an `if` together with the option unwrap -- all three must succeed.
    OnPlayPressed(Presser : agent) : void =
        if:
            Anim := EmoteAnim?
            Character := Presser.GetFortCharacter[]
            Controller := Character.GetPlayAnimationController[]
        then:
            # Play() returns the instance IMMEDIATELY -- it does not suspend.
            # The optional ?params let you re-time and blend the clip.
            Instance := Controller.Play(
                Anim,
                ?PlayRate := 1.0,      # 1.0 = authored speed
                ?BlendInTime := 0.2,   # ease in over 0.2s
                ?BlendOutTime := 0.2)  # ease out over 0.2s
            set CurrentAnim = option{Instance}
            Print("Playing animation on the presser's character")
struct MyHealthStation extends Actor:
    # This is our 'Cooldown' variable.
    # Think of it like a 'Ready/Busy' light.
    # 'false' means the station is ready to use.
    IsBusy: bool = false
    
    # This is the timer device.
    # We will use this to wait before resetting the station.
    ResetTimer: Timer = Timer{}
    
    # This is the 'Event' function.
    # It runs automatically when a player presses E on this object.
    # 'Player' is the person who pressed the button.
    OnInteract(Player: Player):
        # CHECK 1: Is the station currently busy?
        # If IsBusy is true, we skip the rest of this code.
        if (IsBusy):
            # Optional: You could play a sound here saying "Wait!"
            return
        
        # CHECK 2: Is the player actually hurt?
        # We check their current health. If it's less than 100, they need help.
        if (Player.GetHealth() < 100):
            
            # REWARD: Give them a Shield Potion.
            # We use the 'Item' device to grant the item directly to the player.
            # Note: In a real scenario, you'd use the Item Device from the gallery.
            # For this script, we simulate the effect by healing them directly.
            Player.Heal(50)
            
            # OPTIONAL: Give them a Hop Rock for fun!
            # Player.GiveItem("Hop_Rock") # Uncomment if you have the item ID
            
            # UPDATE: Set the station to 'Busy'.
            # Now other players can't use it until the timer finishes.
            IsBusy = true
            
            # ACTION: Start the cooldown timer.
            # We tell the timer to wait 5 seconds, then call 'OnTimerFinished'.
            ResetTimer.Start(5.0, OnTimerFinished)
Change the Car's Colours verse-library
# cannot be constructed with `material{}`, so a concrete device can't give it a
# plain default. Declaring the slot as `?material = false` is the idiom — the
# editor fills it in, and Verse unwraps it with `Paint?`.

car_body_tag := class(tag) {}
car_paint_button_tag := class(tag) {}

car_material_colors_device := class(creative_device):
if (FortCharacter.TeleportTo[PadTransform.Translation, PadTransform.Rotation]):
                false

        # Make the light flash by playing the cinematic sequence!
        # The sequence should be set up in the editor to flash your
        # chosen light from red back to off over ~1 second.
        FlashSequence.Play()
# TargetPosition is a Vector (X, Y, Z coordinates).
    # We start with it set to (0,0,0) until we give it an order.
    TargetPosition : vector = <0,0,0>
    
    # IsMoving is a boolean (True/False).
    # Like a light switch: on or off.
    IsMoving : bool = false
    
    # FUNCTION: This is our custom command.
    # When we call this, the NPC will start walking.
    MoveToTarget := func() {
        # Check if we are already moving.
        # If yes, do nothing (don't double up on orders).
# We store these here so we can cancel them later.
    # Think of these as the "mute buttons" for each input.
    var ButtonSubscriptions : []cancelable = array{}

    # 3. The "State" of our puzzle.
    # False = Puzzle is active. True = Puzzle is solved.
    var IsSolved : logic = false

    # This function runs when the script starts.
    OnBegin<override>()<suspends> : void =
        # Subscribe to both buttons' interaction events.
        SubscribeToButtons()
var IsArmed<private>: logic = true

    OnBegin<override>()<suspends>: void =
        Trigger.TriggeredEvent.Subscribe(OnPlayerStep)

    OnPlayerStep<private>(Agent: ?agent): void =
        # Check the switch. If IsArmed is false, do nothing.
        if (IsArmed?):
            # Disarm FIRST so a second player can't trigger it
            # while we're still running this code.
            set IsArmed = false
            if (ValidAgent := Agent?):
                if (Character := ValidAgent.GetFortCharacter[]):
                    Character.Damage(DamageAmount)
                    LaunchVector := vector3{X := 0.0, Y := 0.0, Z := LaunchForce}
                    Character.ApplyImpulse(LaunchVector)
class RevengeTrap is CoreGame.AActor {
    # 1. Variables (The "Inventory Slots")
    # We need a reference to the visual part of our trap (the mesh)
    VisibleMesh: CoreGame.StaticMeshComponent = CoreGame.StaticMeshComponent{}
    
    # A variable to track if the trap is active (like a health bar)
    IsTriggered: bool = false
    
    # The distance at which the trap becomes visible (like trigger radius)
    DetectionRadius: float = 500.0

    # 2. OnBeginPlay (The "Loadout" Phase)
    # This runs once when the game starts
    OnBeginPlay() -> void override {
        super.OnBeginPlay()
        
        # Make sure we have a mesh to modify
        if (VisibleMesh != null) {
            # Set the initial state: INVISIBLE
            # We use SetMaterial to change the material properties
            # Think of this as equipping a "Stealth Skin"
            SetInvisibleMaterial()
        }
    }

    # 3. OnOverlap (The "Trigger" Phase)
    # This runs when something (a player) walks into our radius
    OnOverlap(Other: CoreGame.Actor) -> void override {
        # Check if the thing that hit us is a Player
        if (Other is CoreGame.Player) {
            # Check if we aren't already triggered
            if (IsTriggered == false) {
                IsTriggered = true
                SetVisibleMaterial() # Switch to the "Red Alert" skin
            }
        }
    }

    # Helper Function: Make it Invisible
    # Analogy: Equipping the "Ghost" item
class BikeSpawnScript is GameScript():
    
    # VARIABLE: A slot to hold a reference to our Sportbike Spawner device.
    # We'll link this in the editor later.
    SpawnDevice: SportbikeSpawnerDevice = SportbikeSpawnerDevice{}

    # VARIABLE: A boolean flag (true/false) to track if a bike is currently spawned.
    # Like a light switch: ON or OFF.
    is_bike_spawned: bool = false

    # EVENT: This function runs automatically when a player enters the Trigger Volume.
    # "Player" is the person who stepped on the pad. "Volume" is the trigger itself.
    OnBeginOverlap(Player: Player, Volume: TriggerVolume) -> void:
        # CHECK: Is a bike already there?
        if is_bike_spawned == true:
            # If yes, do nothing. We don't want two bikes in one spot.
            # You could add a sound effect here to tell the player "No Room!"
            return
        
        # ACTION: Spawn the bike at the player's current location.
        # We use the SpawnDevice we linked earlier.
        # The bike will appear facing the same direction the player is facing.
        SpawnDevice.SpawnVehicle(Player.GetTransform())
        
        # UPDATE VARIABLE: Set our flag to true.
        # Now the game knows a bike is on the island.
        is_bike_spawned = true

    # EVENT: This function runs automatically when a player leaves the Trigger Volume.
    OnEndOverlap(Player: Player, Volume: TriggerVolume) -> void:
        # ACTION: Despawn (remove) the bike from the world.
        # This cleans up the mess so the next player can spawn one.
        SpawnDevice.DespawnVehicle()
        
        # UPDATE VARIABLE: Set our flag back to false.
        # The spot is empty again.
        is_bike_spawned = false
# Wire this up in the UEFN Details panel by selecting your "Anvil" prop mover.
    @editable
    Anvil : prop_mover_device = prop_mover_device{}

    # 2. Create a Variable to store the killer's agent reference.
    # This is like a logbook entry. It starts empty (?agent holds an optional value).
    var KillerAgent : ?agent = false

    # 3. The "OnBegin" Event.
    # This function runs exactly once when the match starts.
    OnBegin<override>()<suspends> : void =
        # Get all players currently in the game via the fort_playspace.
        # GetPlayspace() returns the active playspace for this island.