# This line tells Verse: "Hey, I want to use the tools that let me interact with Players."
# Think of this as equipping your loadout before a match.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Players }
# This is the main "Actor" or "Entity" your script controls.
# In the scene graph, this is the root of your code.
# It’s like the Battle Bus: everything starts and ends here.
actor ShieldVendingMachineDevice is Interactible {
# Variables are like your inventory slots.
# We define a constant here: the amount of shield to give.
# 'const' means it can't change, like the rules of the game mode.
const ShieldAmount: int = 50
# This is the Event. It's the trigger.
# It fires when a player interacts with this device.
# 'Interact' is the signal; 'Player' is the person who sent it.
event OnInteract(Player: Player) {
# Before we give shield, let's make sure the player is actually alive.
# If they're in the lobby or eliminated, we don't want to break things.
if (Player.IsAlive() == true) {
# Here is the API Call. We are asking the Player object
# to change its shield value.
# .SetShield() is the method (the action).
# We pass (ShieldAmount) as the argument (the data).
Player.SetShield(ShieldAmount)
# Optional: Let's give the player a tiny bit of health too,
# just to make it feel like a "heal station."
Player.SetHealth(10)
Verse Library
verse
01 Fragment
Defines an interactible device that grants shield and health to alive players upon interaction.
verse-library/using-shield-consumables-in-fortnite-creative/01-fragment.verse
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.