hasItem

Description

Checks whether the player currently has at least the specified amount of an item.

Parameters

  • item (string): The name/key of the item (e.g., "id_card").

  • amount (number, optional): How many of the item to check for (default: 1).

Return Value

  • Returns true if the player has enough of the item.

  • Returns false otherwise.

Example Use Case

if ps.hasItem("repairkit", 2) then
    print("Player has 2 repair kits.")
else
    print("Not enough repair kits.")
end

Last updated