# This is a simple script for a LEGO brick # It makes the brick glow when a player touches it using { /Fortnite.com/Devices } using { /Fortnite.com/Characters } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # We create a "Device" called GlowingBrick # This is like a special LEGO piece with magic GlowingBrick := class(creative_device): # TriggerDevice is placed in the editor and linked here. # It detects when a player enters the brick's area. @editable Trigger : trigger_device = trigger_device{} # This runs when the game starts OnBegin() : void = # We wait for a player to activate the trigger # This is called an "Event" Trigger.TriggeredEvent.Subscribe(OnBrickTouched) # This function runs when the trigger fires # Agent is the player who stepped on the trigger OnBrickTouched(Agent : ?agent) : void = # Turn the agent into a fort_character so we can use character actions if (A := Agent?, Character := A.GetFortCharacter[]): # Print a message to the output log to confirm the glow fired # note: Verse has no runtime SetMaterialColor API for creative_devices; # use a customizable_light_device linked via @editable to change color at runtime. Print("Brick touched by a player — trigger the glow light here!")