# Import the devices we need to use using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # This is our main island script my_island := class(creative_device): # Wire your Water Device here in the UEFN Details panel @editable Pool : water_device = water_device{} # Wire your Button Device here in the UEFN Details panel @editable SecretButton : button_device = button_device{} # This variable holds the water height # It starts at 0.0 (no water) # 'var' means we are allowed to change it later var WaterHeight : float = 0.0 # This function raises the water # It takes one number as input RaiseWater(Level : float) : void = # We update our variable with the new level set WaterHeight = Level # We tell the water device to enable (show water) # and use SetWaterBodyHeight to move the surface # note: water_device exposes Enable/Disable and # SetWaterBodyHeight(float) in the real Verse API Pool.SetWaterBodyHeight(WaterHeight) # This event happens when the game starts # We make sure the water starts empty OnBegin() : void = # Hide the water at game start by disabling the device Pool.Disable() # Subscribe to the button's interaction event SecretButton.InteractedWithEvent.Subscribe(OnButtonPressed) # This function runs whenever a player interacts with the button # agent is the player who pressed it OnButtonPressed(Agent : agent) : void = # Raise the water to 500.0 centimeters high! # Verse uses centimeters, so 500.0 = roughly 5 meters # You can change 500.0 to any height you like Pool.Enable() RaiseWater(500.0)