How to stop duplicate items from happening

for my game i made it so you spawn with 3 random items but it is able to give you a duplicate item so i was wondering how to stop this from happening

You can repeatedly pick a random item type and store it in a global variable whose data type is ‘itemType’, check if the unit already owns an item of that type (it is a duplicate), and if so, pick a random item type again. At the end, an item type will be picked that the unit does not already own and stored in the global variable. You can then give that item to the unit.

1 Like

oh dang thanks i didnt think anyone actually had an answer

1 Like