using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Schemas }
# This is our "Beach Cooler" script
# It inherits from a basic device, meaning it can be placed in the world
class BeachCoolerDevice is Device()
# A variable to hold the item we want to give.
# Think of this as the "Loot Table" for this cooler.
# We'll set this in the editor properties later.
var ItemToGive : ItemDefinition = ItemDefinition{}
# This function runs when a player enters the device's trigger volume.
# In game terms: "When a player touches the cooler..."
OnBegin<override>()<suspends>: unit =
{
# Connect to the "OnBegin" event of the device.
# This is like setting up a tripwire.
OnBeginEvent <- OnBeginEvent+OnBegin
# Wait for the player to interact (touch)
# We'll use a simple loop to listen for interactions
for (Player : GetPlayers())
{
# Check if the player is inside our trigger
if (IsPlayerInTrigger(Player))
{
# Give the player the item defined in our variable
Player.GiveItem(ItemToGive)
Verse Library
verse
01 Fragment
Assigns an item definition to a cooler device that dispenses it upon player trigger interaction.
verse-library/using-seaside-prefabs-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.