// This is a simple explanation of the logic.
// In UEFN, you mostly use the visual device connections,
// but here is how the code thinks:
// 1. The Game checks the player's inventory.
if (Player.HasItem(Jewel)) {
// 2. If the player has the Jewel...
Door.Open();
// 3. ...then open the door!
} else {
// 4. If the player does NOT have the Jewel...
Door.Lock();
// 5. ...keep the door locked.
}
Verse Library
verse
01 Fragment
Checks player inventory for a specific item to automatically open or lock connected doors.
verse-library/using-items-in-fortnite-creative/01-fragment.verse