GetOfferAsync

TPPersonalizedOffer.GetOffersAsync(userId)

Description

GetOfferAsync retrieves an offer content asynchronously and saves it to the Roblox’s data store called “Offers-TentuPlay”. And also returns the offers table.

500

You can use Roblox’s data store as shown in the code example.

local offers = DataStoraService:GetDataStore("Offers-TentuPlay")
local data = offers:GetAsync(userId)

GetOffersAsync must be called only after a certain amount of time configured in TentuPlaySettings.offersGetInterval has passed. If not, the following message will be printed on the Roblox Studio console in TentuPlay debug mode.

TPDebug||GetOffersAsync started but too soon to send : GetOffersAsyncTs

Parameters

Name Description Required

UserId

Player’s unique user ID (not a character’s ID) that is given by Roblox: Player.UserId

Required