# Import the core Verse libraries we need use: core use: player use: device # Define our script. This is the brain of our island. # 'concrete' means this is a real, active object in the scene. ObjectiveGuide := class: # This is a 'Variable'. Think of it as a backpack slot. # We are storing a reference to our HUD Message device. # 'device_handle' is like a remote control for the device. objective_message: device_handle = device_handle{} # This is a 'Function'. It’s a set of instructions we can run. # 'Activate' is a special function that runs when the device starts up. Activate(): void = # 'Get_Device()' looks in the scene for the device named 'objective_message' # and gives us control over it. hud := Get_Device(objective_message) # Now we check if we actually found the device. # If 'hud' is valid, we proceed. if (hud.IsValid()): # We want to show the message when a player joins. # We connect the 'OnPlayerJoined' event to a function we'll write next. hud.OnPlayerJoined.Bind(ShowObjective) # This is the function that actually shows the text. # 'p' stands for 'player'. Every time a player joins, Verse calls this. ShowObjective(p: player): void = # We get the device again (or use the stored one) hud := Get_Device(objective_message) if (hud.IsValid()): # 'Show_Message' is the command that flashes text on the screen. # We pass the player 'p' so only they see it (or everyone, depending on device settings). hud.Show_Message(p) # This is another special function. 'OnBeginPlay' runs once when the island starts. # We use it to set up our connections. OnBeginPlay(): void = # We call our Activate function to set everything up. Activate()