# This is our blueprint for the Prop Team. # It inherits from base_team (the standard team logic) so we get basic stuff for free. prop_team : base_team = class: # Define the time threshold for the heartbeat. # If a prop is still for this long, they squeak. HeartbeatThreshold: float = 3.0 # This is the main function that runs for every Prop player. # means this function can pause and wait for things to happen # without freezing the whole game. RunPropGameLoop(PropAgent:agent):void = # Print to the debug log so we know this player is being tracked. Logger.Print("Prop Agent {PropAgent} is now hiding.") # We start a loop. This is the "infinite" check-in. # It runs forever until the player is eliminated or leaves. loop: # Reset the "moved" flag. We assume they are still until proven otherwise. has_moved := false # This is the RACE. We are racing two tasks: # 1. Waiting for the player to move (MovementCheck) # 2. Waiting for the heartbeat timer to run out (TimerCheck) race: # TASK 1: Check for movement. # We wait until the player's position changes. # Note: In a real full implementation, you'd compare Vector positions. # Here we use a simplified event-based approach for clarity. wait_for_movement(PropAgent): # This is a placeholder for the actual movement detection logic. # In real Verse, you'd check Delta Location or use a movement event. # For this tutorial, we assume an event 'OnPlayerMoved' exists # or we poll the agent's location. # Let's simulate waiting for a move event: await PropAgent.OnPlayerMoved # Simplified concept # If we get here, the player moved! has_moved := true Logger.Print("Prop moved! Resetting heartbeat.") # TASK 2: The Heartbeat Timer. # We wait for our threshold time to pass. wait_for_heartbeat(): Sleep(HeartbeatThreshold) # If the timer finishes, and the player HAVEN'T moved, trigger the sound. if not has_moved: Logger.Print("Heartbeat triggered! You're squeaking!") # Play a sound effect here using PlaySoundOnPlayer(PropAgent, HeartbeatSound) # Once the race completes (either they moved, or they squeaked), # we loop back to the start to check again. Sleep(0.0) # Brief pause to prevent CPU overload