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

Player points gui help?

Asked by 9 years ago
-- In LocalScript --

local PointsService = Game:GetService("PointsService")
local productId = 21263542
local players = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
    Game:GetService("MarketplaceService"):PromptProductPurchase(players, productId)
    game.Players.PlayerAdded:connect(function(player)
        while wait(1) do
            local pointsToAward = PointsService:GetAwardablePoints()
            if ( pointsToAward >= 100) then 
                pcall(function()
                    PointsService:AwardPoints(player.userId, 100) 
                end)
            end
        end
    end)
end)

I have this set so when you buy a tip to support my game you get some player points in return. I just want them to get 100 but it wont award them it. The game has 1200 so to my mind it should work but dosent want to.

1 answer

Log in to vote
0
Answered by 9 years ago

Because PlayerPoints cant be awarded from PlayerGui

Ad

Answer this question