// 1. IMPORT: Bring in the "Cheat Sheet" for Players // Without this, Verse doesn't know what a "Player" is. import Players from "Fortnite.com" // 2. DEFINE: Create a new Device type called HealthChecker // Think of this as the blueprint for your trap/healer. struct HealthChecker : WorldDevice { // 3. DEFINE: A simple event that fires when the game starts // This is like the "Start" button on a controller. OnBegin() { // We don't do anything yet, but this is where we'd set up listeners } // 4. DEFINE: A function that takes a Player and returns their health // This is a reusable tool. You can use this on ANY player. GetPlayerHealth(player: Players.Player) : int32 { // 5. API CALL: Access the Health component of the Player // player.GetHealth() is the question we ask the game. // The game answers with an integer (whole number). return player.GetHealth() } }