Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

MarketPlaceService help, again?

Asked by 10 years ago

The following script looks correct to me, but the Purchase Panel won't show up? Why? Where have I done a mistake? Could someone please help me? this is in a NORMAL script

local buyButton = game.Workspace.Buttons.BuyButton.SurfaceGui.TextButton
buyButton.MouseButton1Click:connect(function(LocalPlayer)
    local user = LocalPlayer.userId
    local productId = 19251902
    Game:GetService("MarketplaceService"):PromptProductPurchase(LocalPlayer, productId)
    local PointsService = Game:GetService("PointsService")
    local pointsToAward = PointsService:GetAwardablePoints()
    game.Players.LocalPlayer.leaderstats.Diamonds.Value = LocalPlayer.leaderstats.Diamonds.Value + 10
    if ( pointsToAward > 0) then
        PointsService:AwardPoints(player.userId, 1)
    end
end)

Answer this question