# This is our main script file. # It controls the magic fish bowl. using { /Fortnite.com/Devices } using { /Fortnite.com/Characters } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # This is our device class. # It holds the fish and moves it. magic_fish_bowl := class(creative_device): # This is our Prop Mover device. # Connect it in the editor by selecting your PropMoverDevice. @editable MyPropMover : prop_mover_device = prop_mover_device{} # This is our Item Granter device. # It gives the fish item to the player. # Note: item_granter_device is the real API for handing items to players. @editable MyItemGranter : item_granter_device = item_granter_device{} # This is our Button device. # The player clicks it to get a fish. @editable MyButton : button_device = button_device{} # This function runs when the game starts. OnBegin() : void = # Tell the Button to call OnButtonPressed when clicked. # We will tell it when to move later. Print("The fish bowl is ready!") MyButton.InteractedWithEvent.Subscribe(OnButtonPressed) # This function runs when the player clicks the button. # We call this an "Event". OnButtonPressed(Agent : agent) : void = # Check if the player clicked us. # If yes, send the fish! Print("Sending the magic fish!") # This line tells the Item Granter to give the fish. # The item to grant is set on the item_granter_device in the editor. # Note: Set the item to "Slurpfish" on MyItemGranter in the editor UI. MyItemGranter.GrantItem(Agent) # This line tells the Prop Mover to move. # It moves toward the player's position. MyPropMover.Begin()