# This is the main script for our upgrade system. # We call this script "SentryUpgrader". using { /Fortnite.com/Devices } using { /Verse.org/Simulation } # This is our main class. It holds all our devices. SentryUpgrader := class(creative_device): # These are our "slots" for devices. # We will drag devices from the editor into these slots. @editable weak_sentry: sentry_device = sentry_device{} @editable strong_sentry: sentry_device = sentry_device{} @editable upgrade_button: button_device = button_device{} # This function runs when the game starts. OnBegin(): void = # We wait for the button to be pressed. # This is like waiting for a drumbeat. upgrade_button.InteractedWithEvent.Await() # When the button is pressed, we do this: # 1. Hide the weak sentry. # We send a "Despawn" signal to it. weak_sentry.DestroySentry() # 2. Show the strong sentry. # We send a "Spawn" signal to it. strong_sentry.Spawn() # 3. Print a message to help us debug. # This helps us know the code is working. Print("Upgrade complete! Watch out!")