# This is a simple Verse script for a device. # It says hello when a player enters its zone. using { /Fortnite.com/Devices } using { /Fortnite.com/Characters } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # This is the main class for our device. # Think of it as the robot's body. my_hello_device := class(creative_device): # A trigger_device is wired in the editor to detect when # a player walks into its zone. # note: wire this to a Trigger Device placed near your Verse device in UEFN. @editable Trigger : trigger_device = trigger_device{} # This runs once when the game starts. OnBegin(): void= # We print a message to the log. # This helps us know the code is running. Print("My device is ready!") # Subscribe to the trigger so we know when a player enters. Trigger.TriggeredEvent.Subscribe(OnTriggered) # This runs when a player enters the trigger zone. # 'Agent' is the player who touched it. OnTriggered(Agent : ?agent): void= # Check if the agent is a player. if (A := Agent?): # Print a friendly message. Print("Hello, Player!")