# This line tells Verse: "Hey, this script belongs to a specific device." # We link it to the 'HealthStation' prop we placed in the world. struct MyHealthStation extends Actor: # This is our 'Cooldown' variable. # Think of it like a 'Ready/Busy' light. # 'false' means the station is ready to use. IsBusy: bool = false # This is the timer device. # We will use this to wait before resetting the station. ResetTimer: Timer = Timer{} # This is the 'Event' function. # It runs automatically when a player presses E on this object. # 'Player' is the person who pressed the button. OnInteract(Player: Player): # CHECK 1: Is the station currently busy? # If IsBusy is true, we skip the rest of this code. if (IsBusy): # Optional: You could play a sound here saying "Wait!" return # CHECK 2: Is the player actually hurt? # We check their current health. If it's less than 100, they need help. if (Player.GetHealth() < 100): # REWARD: Give them a Shield Potion. # We use the 'Item' device to grant the item directly to the player. # Note: In a real scenario, you'd use the Item Device from the gallery. # For this script, we simulate the effect by healing them directly. Player.Heal(50) # OPTIONAL: Give them a Hop Rock for fun! # Player.GiveItem("Hop_Rock") # Uncomment if you have the item ID # UPDATE: Set the station to 'Busy'. # Now other players can't use it until the timer finishes. IsBusy = true # ACTION: Start the cooldown timer. # We tell the timer to wait 5 seconds, then call 'OnTimerFinished'. ResetTimer.Start(5.0, OnTimerFinished) # This function runs AFTER the timer finishes. OnTimerFinished(): # The wait is over! Reset the 'Busy' light to green. IsBusy = false