How to prevent if a player already owns a specific item and they want more then it wont give them the same item again

I don’t know how to prevent players getting the same item they owned, so I need
some help with you guys.

1 Like

Check of the player already owns an item and don’t allow the function or code to continue.

--example
function purchase(player, itemId)
  if player.Items:FindFirstChild(itemId) then
    --checks if the itemId was found under a folder named "Items" in the Player object
    return --stop the function
  end

  --...
end
2 Likes