# This script checks for Wood and gives a reward using { /Fortnite.com/Devices } using { /Verse.org/Sim } # We create a new script called ResourceShop ResourceShop := class(script): # This runs when the game starts OnBegin(): void= # We wait for the player to press the button # We assume a button device is linked in the editor if button_pressed: # Check if the player has 5 Wood if player_has_resource("Wood", 5): # Give the player a Health Potion give_reward("Health Potion") else: # Tell the player they need more Wood show_message("Need 5 Wood!")