# This is our main script. It controls the game logic. using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # This is our main class. It holds all our code. my_button_script := class(creative_device): # Here is the magic link! # We create a variable named 'MyButton'. # It expects a 'button_device'. # In the editor, you will drag your actual button here. @editable MyButton: button_device = button_device{} # We also need a link to a prop_manipulator_device. # Drag your placed Prop Manipulator into this slot in the editor. # note: prop_manipulator_device lets us change a prop's appearance at runtime. @editable MyPropManipulator: prop_manipulator_device = prop_manipulator_device{} # This function runs when the game starts. OnBegin(): void = # We wait for the button to be pressed. # 'InteractedWithEvent' fires each time a player clicks the button. MyButton.InteractedWithEvent.Await() # When the button is pressed, do this: # Tell the prop manipulator to enable, which triggers # whatever effect you configured on it in the editor. MyPropManipulator.Enable() Print("Button pressed! Prop manipulated!")