# This script checks if a player has the required parts and grants a reward. using { /Fortnite.com/Devices } using { /Fortnite.com/Player } using { /Verse.org/Simulation } # Define the script as a component for a device (like a Trigger) MechanicalCraftingScript := script() { # This runs when the script starts OnStart: virtual function () { # We don't need to do much here for a simple check }, # This function is called when a player enters the trigger zone OnBeginPlay: virtual function (self: MechanicalCraftingScript, player: Player) { # CHECK: Does the player have the Rusty Part? # 'HasItem' is a function that checks the player's inventory. # Think of it like checking your pockets for keys. has_rusty := player.HasItem("Rusty Mechanical Part", 1) # CHECK: Does the player have the Simple Part? has_simple := player.HasItem("Simple Mechanical Part", 1) # LOGIC: If they have BOTH... if (has_rusty and has_simple) { # REMOVE: Take the items away (consumption) # This is like using a potion. The item is gone. player.ConsumeItem("Rusty Mechanical Part", 1) player.ConsumeItem("Simple Mechanical Part", 1) # GIVE: Hand them the Sleek Part # This is like opening a chest. New loot acquired. player.GrantItem("Sleek Mechanical Part", 1) # FEEDBACK: Let the player know it worked # In a real game, you'd play a sound or show text. # For now, we just let the item appear in their inventory. } else { # If they don't have the items, we do nothing. # The player will just stand there, confused. # (You could add a "Error" sound here later). } } }