# This is a simple script to show the logic. # We are checking if a player has two items. using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # A Verse device that wires to a conditional_button_device # and an item_granter_device placed in the UEFN level. crafting_station := class(creative_device): # Drag the Conditional Button device from the level into this slot. @editable Button : conditional_button_device = conditional_button_device{} # Drag the Item Granter device from the level into this slot. @editable Granter : item_granter_device = item_granter_device{} # OnBegin runs once when the game starts. OnBegin() : void = # Subscribe to the button's success event. # TriggeredEvent fires when the player meets ALL key-item conditions. Button.TriggeredEvent.Subscribe(OnCraftingTriggered) # This function runs when a player successfully triggers the button. # note: item consumption is handled automatically by conditional_button_device # when its "Consume Items On Trigger" setting is enabled in the editor. OnCraftingTriggered(Agent : agent) : void = # Grant the reward item to the player who triggered the button. Granter.GrantItem(Agent) Print("Crafting complete!")