using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.comTemporary/Temporal }
# This is our main script, attached to the Button
# Think of this as the "Brain" of the button
security_console := class(VerseSpeaker):
# VARIABLES: These are our "slots" for data.
# AccessLevel is like a player's rank (0 = civilian, 1 = agent)
AccessLevel : int = 0
# The door we want to control. We'll link this in the editor.
# Think of this as pointing to the specific door in the level.
BunkerDoor : PropMoverDevice = PropMoverDevice{}
# The sound to play if access is denied
DeniedSound : AudioDevice = AudioDevice{}
# FUNCTIONS: Reusable blocks of logic.
# This function checks if the player is authorized.
# It returns true or false, like a light switch being on or off.
IsPlayerAuthorized := func(Player : Player): bool ->
# In a real game, you'd check for a specific item or team.
# For this demo, we'll pretend any player with > 0 access is okay.
# Let's say if the player has a specific item "Keycard", we set their access to 1.
# Since we can't easily check items in simple Verse without complex APIs,
# we will simulate it: if the player is on Team 1, they are authorized.
if Player.GetTeam() == 1:
return true
else:
Verse Library
verse
01 Standalone
Defines a security console class that links to door and audio devices while checking player authorization.
verse-library/using-military-galleries-in-fortnite-creative/01-standalone.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.