Pay for the order||doc136056
September 20, 2022
Game.GetService("PayHelper"):payMoney(player, uniqueId, price, callBack)
- The class to which the function belongs:
- Call limit:
A pop-up window prompting payment for the specified player.
When a designated user asks him to pay for the Golden Cube to purchase in-game services, a pop-up window will first prompt the user whether to confirm the purchase, and the payment request will be ignored before the user confirms.
The result of the purchase is used as a parameter to execute the callback function. If it fails, the golden cube is insufficient.
|uniqueId||int||Unique identification of the commodity, range limit [-2147483648 ~ 2147483647]|
|callback||function||Callback function with purchase result as parameter|
When the player dies, give the player a payment request to buy resurrection, and register the death trigger in the player server code
Trigger.RegisterHandler(this:cfg(), "ENTITY_DIE", function(context) local player = context.obj1 Game.GetService("PayHelper"):payMoney(player, 1, 10, function(ret) if ret then player:serverRebirth() end end) end)