# Import the necessary Fortnite devices using { /Fortnite.com/Devices } # Define our script VIP_Lounge_Script := agent { # This is the Class Designer Device. # We need to reference it so we can ask it for members. ClassDesigner: ClassDesignerDevice = ClassDesignerDevice{} # This is the Door (Prop Mover) Door: PropMoverDevice = PropMoverDevice{} # Function to check if the door should be open IsClubOpen := func(): bool { # HERE IS THE MAGIC: GetClassMembers # It asks the ClassDesigner: "Who is a VIP?" # It returns a list (array) of agents. vip_list := ClassDesigner.GetClassMembers() # If the list has at least one player, the club is open! # Think of this like checking if the guest list is empty. return vip_list.Count() > 0 } # This event runs every frame (or tick) OnBegin() := func(): void { # Start a loop that checks the club status loop { # Ask: Is anyone VIP? if (IsClubOpen()) { # Open the door (move it to position 1.0) Door.SetTargetPosition(1.0) } else { # Close the door (move it to position 0.0) Door.SetTargetPosition(0.0) } # Wait a tiny bit before checking again # This prevents the game from freezing by overworking the CPU Wait(0.1) } } }