How It Works

1️⃣ Spotlight Motion System

Each spotlight dynamically oscillates left-right using a set movement speed and range. The angle gradually increases or decreases within a threshold, ensuring fluid motion.

  • light.angle dynamically adjusts based on movement speed.

  • The spotlight’s X and Y positions shift according to the calculated sine wave motion.

  • If the spotlight reaches the maximum angle, it reverses direction for continuous movement.

2️⃣ Player Detection System

The script continuously checks if a player is inside the moving light beam by:

  • Comparing the player’s position with the spotlight’s current position.

  • Verifying if the player is within the specified light range.

  • Triggering a Police Notification Event if the player is detected in the area.

3️⃣ Police Alert Mechanism

  • Cooldown System: Ensures alerts are not spammed by introducing a 5-second cooldown.

  • Automated Detection: If a player repeatedly enters the spotlight, a notification is sent.

Last updated