# We are defining a script that runs on an Actor (the Pressure Plate).
# Think of this as giving the Pressure Plate a brain.
script PressurePlateTrap extends Actor:
# --- VARIABLES (The Inventory Slots) ---
# 'triggered' is a boolean. True/False.
# It’s like a flag on a player’s belt. 'True' means they already got caught.
triggered: bool = false
# 'trap_indicator' is a reference to another object.
# This is like pointing at a specific prop in your inventory.
# We will link this in the editor later.
trap_indicator: Actor = None
# --- EVENTS (The Triggers) ---
# This function runs automatically when a player overlaps with this actor.
# It’s like the 'Elimination' notification popping up.
on_begin_overlap(overlap: Actor) -> unit:
# Check if the thing that touched us is a Player.
# We use 'IsPlayer()' to filter out other things like vehicles or pets.
if overlap.IsPlayer():
# Check if the player hasn't triggered this trap yet.
# This is the 'if' statement. It’s like checking if your shield is up.
if triggered == false:
# 1. Mark the trap as triggered (update the variable).
triggered = true
# 2. Do the trap thing!
# We'll change the color of the indicator prop.
# In a real map, you might spawn a grenade or play a sound.
Verse Library
verse
01 Fragment
Detects player overlaps, enforces single triggers per activation, and updates visual indicator props.
verse-library/using-industrial-galleries-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.