# Light Vs Darkness

<h2 align="center"><mark style="color:green;"><strong>Battleground Event Overview</strong></mark></h2>

{% embed url="https://drive.google.com/file/d/1oPFN_5knsePnpBXE46hD2IL5-Lyq3RQc/view?usp=sharing" %}

This system manages a competitive battleground event between two teams—**Light** and **Darkness**—with mechanics for team formation, score tracking, rewards distribution, and event termination. Below is a detailed breakdown of its functionality:

**1. Pre-Event Checks and Team Setup**

* **Player Requirement Verification**: The system first checks if there are enough players in the waiting rooms to form both teams. If the minimum player count is not met, the event will not start.
* **Team Creation & Assignment**: Players are divided into two factions (Light and Darkness) and assigned to opposing sides on the **"Battle Zone Map."**
* **Waiting Room Cleanup**: Once the event begins, the waiting rooms for both teams are deleted to prevent late entries.

**2. Event Initialization**

* **Player Warping**: Teams are warped to their designated starting positions on the battleground map.
* **Score Initialization**: Both teams begin with a predefined score, which is displayed on a scoreboard.

**3. Event Progression & Score Management**

* **Score Deduction on Death**: Each time a team member dies, their team’s score decreases by one, and the scoreboard updates accordingly.
* **Early Termination Condition**: If a team’s score drops to zero, the event immediately ends, declaring the opposing team the winner.

**4. Event Conclusion & Rewards**

* **Time-Based Ending**: If the event runs for the full duration (in seconds), the team with the higher score is declared the winner.
* **Reward Distribution**:
  * **Winning Team**: Receives a larger reward (e.g., will edit soon ).
  * **Losing Team**: Receives a consolation prize (smaller reward).
* **Post-Event Cleanup**: All participants are warped back to a **designated location**, and the battleground instance is destroyed.

**5. Player Disconnection Handling**

* **Active Event Check**: If a player quits, the system verifies if the battleground is still ongoing.
  * If the event has already ended, no further action is taken.
  * If the event is still active, the quitting player’s team score is **set to zero**, forcing an immediate event end (as the team effectively has no remaining players).\
    \
    **Light Vs Darkness MAP**\
    ![](https://2725615215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLk2e7DwWsLzvXSUnd5J%2Fuploads%2FpUb3GQXYO04Z0i7fUg3X%2FLvD2.png?alt=media\&token=9efb0380-6ff7-4314-8756-a0bae37a69c3)\
    \


NpC Locate at ( will edit soon )
