Skip to main content

GameProductDataService

Functions

Start

GameProductDataService:Start() → ()

Starts the service. Should be done via ServiceBag

HasPlayerPurchasedThisSession

GameProductDataService:HasPlayerPurchasedThisSession(
playerPlayer,
assetTypeGameConfigAssetType,
idOrKeystring | number
) → boolean

Returns true if item has been purchased this session

PromisePromptPurchase

GameProductDataService:PromisePromptPurchase(
playerPlayer,
assetTypeGameConfigAssetType,
idOrKeystring | number
) → Promise<boolean>

Prompts the user to purchase the asset, and returns true if purchased

PromisePlayerOwnership

GameProductDataService:PromisePlayerOwnership(
playerPlayer,
assetTypeGameConfigAssetType,
idOrKeystring | number
) → Promise<boolean>

Returns true if item has been purchased this session

PromiseIsOwnable

GameProductDataService:PromiseIsOwnable(
playerPlayer,
assetTypeGameConfigAssetType
) → Promise<boolean>

Returns true if item has been purchased this session

PromisePlayerIsPromptOpen

GameProductDataService:PromisePlayerIsPromptOpen(playerPlayer) → Promise<boolean>

Promises the player prompt as opened

PromisePlayerPromptClosed

GameProductDataService:PromisePlayerPromptClosed(playerPlayer) → Promise<boolean>

Promises the player prompt as opened

ObservePlayerOwnership

GameProductDataService:ObservePlayerOwnership(
playerPlayer,
assetTypeGameConfigAssetType,
idOrKeystring | number
) → Promise<boolean>

Observes player ownership

ObservePlayerAssetPurchased

GameProductDataService:ObservePlayerAssetPurchased(
playerPlayer,
assetTypeGameConfigAssetType,
idOrKeystring | number
) → Observable<>

Fires when the specified player purchases an asset

ObserveAssetPurchased

GameProductDataService:ObserveAssetPurchased(
assetTypeGameConfigAssetType,
idOrKeystring | number
) → Observable<Player>

Fires when any player purchases an asset

PromisePlayerOwnershipOrPrompt

GameProductDataService:PromisePlayerOwnershipOrPrompt(
playerPlayer,
assetTypeGameConfigAssetType,
idOrKeystring | number
) → Promise<boolean>

Checks if the asset is ownable and if it is, checks player ownership. Otherwise, it checks if the asset has been purchased this session. If the asset has not been purchased this session it prompts the user to purchase the item.

Show raw api
{
    "functions": [
        {
            "name": "Start",
            "desc": "Starts the service. Should be done via [ServiceBag]",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 42,
                "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
            }
        },
        {
            "name": "HasPlayerPurchasedThisSession",
            "desc": "Returns true if item has been purchased this session",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "assetType",
                    "desc": "",
                    "lua_type": "GameConfigAssetType"
                },
                {
                    "name": "idOrKey",
                    "desc": "",
                    "lua_type": "string | number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 74,
                "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
            }
        },
        {
            "name": "PromisePromptPurchase",
            "desc": "Prompts the user to purchase the asset, and returns true if purchased",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "assetType",
                    "desc": "",
                    "lua_type": "GameConfigAssetType"
                },
                {
                    "name": "idOrKey",
                    "desc": "",
                    "lua_type": "string | number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 97,
                "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
            }
        },
        {
            "name": "PromisePlayerOwnership",
            "desc": "Returns true if item has been purchased this session",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "assetType",
                    "desc": "",
                    "lua_type": "GameConfigAssetType"
                },
                {
                    "name": "idOrKey",
                    "desc": "",
                    "lua_type": "string | number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 117,
                "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
            }
        },
        {
            "name": "PromiseIsOwnable",
            "desc": "Returns true if item has been purchased this session",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "assetType",
                    "desc": "",
                    "lua_type": "GameConfigAssetType"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 136,
                "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
            }
        },
        {
            "name": "PromisePlayerIsPromptOpen",
            "desc": "Promises the player prompt as opened",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 152,
                "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
            }
        },
        {
            "name": "PromisePlayerPromptClosed",
            "desc": "Promises the player prompt as opened",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 167,
                "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
            }
        },
        {
            "name": "ObservePlayerOwnership",
            "desc": "Observes player ownership",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "assetType",
                    "desc": "",
                    "lua_type": "GameConfigAssetType"
                },
                {
                    "name": "idOrKey",
                    "desc": "",
                    "lua_type": "string | number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 184,
                "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
            }
        },
        {
            "name": "ObservePlayerAssetPurchased",
            "desc": "Fires when the specified player purchases an asset",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "assetType",
                    "desc": "",
                    "lua_type": "GameConfigAssetType"
                },
                {
                    "name": "idOrKey",
                    "desc": "",
                    "lua_type": "string | number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 207,
                "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
            }
        },
        {
            "name": "ObserveAssetPurchased",
            "desc": "Fires when any player purchases an asset",
            "params": [
                {
                    "name": "assetType",
                    "desc": "",
                    "lua_type": "GameConfigAssetType"
                },
                {
                    "name": "idOrKey",
                    "desc": "",
                    "lua_type": "string | number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Player>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 230,
                "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
            }
        },
        {
            "name": "PromisePlayerOwnershipOrPrompt",
            "desc": "Checks if the asset is ownable and if it is, checks player ownership. Otherwise, it checks if the asset\nhas been purchased this session. If the asset has not been purchased this session it prompts the user to\npurchase the item.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "assetType",
                    "desc": "",
                    "lua_type": "GameConfigAssetType"
                },
                {
                    "name": "idOrKey",
                    "desc": "",
                    "lua_type": "string | number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 267,
                "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "GameProductDataService",
    "desc": "",
    "source": {
        "line": 4,
        "path": "src/gameproductservice/src/Shared/GameProductDataService.lua"
    }
}