Verse Library verse

01 Fragment

Detects when players consume specific items and temporarily increases their movement speed.

verse-library/using-ice-cream-consumables-in-fortnite-creative/01-fragment.verse

# This is a "Script" - it's the brain of our island.
# It runs in the background, watching for player actions.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Items }
using { /UnrealEngine.com/Temporary/SlateUI }

# We define our Script. Think of this as the "Container" for our logic.
IceCreamSpeedBoostScript = script():
    # This is an "Event". It’s like a tripwire.
    # When a player consumes an item, this function fires.
    OnPlayerConsumedItem := bind (player: Player, item: Item):
        # We need to check if the item is an Ice Cream.
        # In Verse, we check the "Item Type".
        if (item.Get_Item_Type() == /Fortnite.com/Items/IceCreamCone):
            # If it IS ice cream, let's do something cool.
            
            # 1. Find the player's movement component.
            # This is like opening the settings menu for that specific player.
            movement := player.Get_Movement_Component()
            
            # 2. Change their speed.
            # We add 200.0 to their current speed.
            # Think of this as pressing the 'Shift' key to sprint, but permanently for a few seconds.
            if (movement != None):
                movement.Set_Move_Speed(200.0)
                
                # Optional: You could also heal them here!
                # health := player.Get_Health_Component()
                # health.Add_Health(5.0)

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