OSL ‐ Items - Mistium/Origin-OS GitHub Wiki
1. Purchase an Item
items "purchase" "id"
// Opens a popup that prompts the user to purchase the item specified by its unique "id".
// this will not return any value. You should check every frame to see if the user has gained the item.
This function triggers a popup that allows the user to purchase an item. The item is identified by its unique "id". When called, it prompts the user with the option to confirm the purchase.
2. Check if the User Owns an Item
items "owns" "id"
data = itemOwns("id")
// Sets the data variable to true or false, based on whether the user owns the item specified by its "id".
This function checks if the user already owns a specific item. The item is identified by its unique "id". If the user owns the item, it sets the data
variable to true
; otherwise, it sets data
to false
.
3. Check if the User Created an Item
items "created" "id"
data = itemCreated("id")
// Sets the data variable to true or false, based on whether the user created the item specified by its "id".
This function checks if the user is the creator of a specific item. The item is identified by its unique "id". If the user created the item, it sets the data
variable to true
; otherwise, it sets data
to false
.
4. Get All Owned Items
data = user["sys.purchases"]
This command retrieves a list of all items that the user currently owns. The list is stored in the data
variable as an array of item IDs representing the user's purchases.
5. Get All Created Items
data = user["sys.items"]
This command retrieves a list of all items that the user has created. The list is stored in the data
variable as an array of item IDs representing the user's creations.