# We need to import the basic tools to talk to the game world using { /Fortnite.com/Devices } using { /UnrealEngine.com temporary/Engine } # This is our main script, attached to the island # Think of this as the "Game Master" entity # It holds the state of the game [CreateByRef] var MainGame: { # This variable is our "Current Theme" # It’s like your current weapon slot. # We start with "Medieval" (represented by 0) CurrentTheme: int = 0 # This function is the "Rebirth Van" # It takes no input, but it changes the world # It's a "procedure" because it does something rather than returns a value ApplyTheme() -> void: # First, we hide the current theme # If CurrentTheme is 0, we hide Medieval_Props # If CurrentTheme is 1, we hide Cyber_Props # We use a simple check, like deciding which path to take at a fork in the road if (CurrentTheme == 0): # Get the Medieval props group # We assume we have a reference to this entity in our editor setup # In a real build, you'd link this via the editor's "Variable" tab Medieval_Props.SetVisibility(Visibility: Hidden) # Now, show the Cyber props # This is like swapping your shield potion for a chug splash Cyber_Props.SetVisibility(Visibility: Visible) # Update our "Loadout" variable to remember we are now in Cyber mode CurrentTheme = 1 else: # If we are already in Cyber mode, we go back to Medieval Cyber_Props.SetVisibility(Visibility: Hidden) Medieval_Props.SetVisibility(Visibility: Visible) CurrentTheme = 0 # This event fires when the game starts # It’s like the "Ready Up" screen OnBegin(): # When the game begins, make sure everything is hidden first Medieval_Props.SetVisibility(Visibility: Hidden) Cyber_Props.SetVisibility(Visibility: Hidden) # Wait for player input... # We'll handle the button clicks in a separate event or loop # For simplicity, we'll just wait here for now Wait(1.0) } # This is the "Trigger" for our buttons # We attach this script to the Switches in the editor [CreateByRef] var ThemeButton: { # Reference to the MainGame script so we can change its theme MainGame: MainGame # This event fires when the button is pressed OnActivated(): # Call the MainGame's function to swap the world MainGame.ApplyTheme() # Optional: Give the player a little feedback # Like the sound effect when you pick up a keycard MainGame.BroadcastMessage("Theme Changed!") }