heist_controller := class(creative_device):
# 2. Variables (The Changing Stats)
# A "variable" is a value that can change during the game,
# like a player's health or score.
my_spawner: vehicle_spawner_armored_transport_device = ?
vault_device: bank_vault_device = ?
# Constants are set once and never change.
# Here, Team 1 is "Security" (can drive), Team 2 is "Thieves" (can crack).
const SECURITY_TEAM: int = 1
const THIEF_TEAM: int = 2
# 3. The "On Begin" Function
# This runs once when the game starts.
# It's like the "Ready Up" screen before the match begins.
OnBegin<override>()<suspends>: void =
# Find the spawner by its name.
# If you named your device differently, change "MyHeistTruck" here.
my_spawner = GetDevice<vehicle_spawner_armored_transport_device>("MyHeistTruck")
if (my_spawner != ?):
# Spawn the truck immediately!
# This is like pressing "Play" to start the event.
spawned_vehicle := my_spawner.Spawn()
# 4. Navigating the Scene Graph
# The truck is the Parent. The vault is inside it.
# We need to find the vault component inside the truck.
# Note: In real UEFN, you might need to link the vault
# via a device connection or find it via the vehicle's components.
# For this tutorial, we assume we can access the vault
# through the spawned vehicle's interface or a linked device.
# Let's configure the driving rules.
# Set the vehicle to only allow Security Team to drive.
# This is like putting a lock on the driver's seat.
my_spawner.SetAllowedTeams({SECURITY_TEAM})
# Now, let's configure the vault.
bank_vault_device
devicebank_vault_device<public> := class<concrete><final>(creative_device_base, bank_vault_interface)
A vault door that requires a start of a sequence to damage a number of weakpoints to open.
- Module
- /Fortnite.com/Devices
- Source
- fortnite