# This code makes the Item Granter work # It listens for the Trigger signal using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # Define our main device # This is the "brain" of our Gear Station GearStation := class(creative_device): # We connect the Trigger to the Granter # When the Trigger fires, the Granter acts @editable Trigger : trigger_device = trigger_device{} @editable Granter : item_granter_device = item_granter_device{} # This function runs when the game starts OnBegin() : void = # We tell the Trigger to listen # It watches for players stepping on it Trigger.TriggeredEvent.Subscribe(OnTriggered) # This function runs each time the Trigger fires OnTriggered(Agent : agent) : void = # The Trigger fired! # Now we tell the Granter to give items to the agent Granter.GrantItem(Agent)