using /Fortnite.com/Game using /Verse.org/SceneGraph using /Verse.org/Simulation # We define a script that will live on an Entity. # The 'Simulation' entity is the brain of the island. class ChaosRoundManagerScript is Script(): # This variable tracks if the round is currently active. # It's a 'boolean' (logic): true or false. var is_round_active: logic = false # This is the main function that runs when the script starts. # It sets up the subscriptions (the "listeners"). OnBegin(): void = # Get the round manager interface from the game. # This is how we talk to the Fortnite engine. round_manager := GetFortRoundManager() # Subscribe to the "Round Started" event. # When a round starts, run the StartRound function. # We store the subscription in a variable so we can cancel it later if needed. round_manager.SubscribeRoundStarted(StartRound) # Subscribe to the "Round Ended" event. # When a round ends, run the EndRound function. round_manager.SubscribeRoundEnded(EndRound) # Print a message to the debug console to confirm it's working. print("Chaos Arena: Subscriptions Active!") # This function runs when a round STARTS. StartRound(Round: Round): void = # Only do this if the round isn't already active. # This prevents double-healing or double-spawning. if (is_round_active == false): is_round_active = true # 1. HEAL EVERYONE # We get all players and heal them. # (In a real game, you'd use a Healer device or broadcast heal) for player := GetPlayers(): player.Heal(100) # 2. SPAWN ENEMIES # For this demo, we'll just print a message. # In a real script, you'd trigger a Prop Spawner here. print("Chaos Arena: Round Started! Enemies Spawning!") # 3. START THE TIMER (Simulated) # We'll wait 10 seconds, then end the round. # In a real game, you might wait for all players to die. Wait(10.0) EndRound() # This function runs when a round ENDS. EndRound(): void = if (is_round_active == true): is_round_active = false # 1. RESET THE STATE print("Chaos Arena: Round Ended! Resetting...") # 2. CLEAR ENEMIES (Simulated) # In a real game, you'd destroy enemy props here. # 3. START THE NEXT ROUND # We call StartRound again to loop the game. StartRound()