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

Would this award player points if you clicked on a Gui?

Asked by 10 years ago
 local buyButton = script.Parent
local productId = 20859896
local PointsService = Game:GetService("PointsService")
local pointsToAward = PointsService:GetAwardablePoints()

buyButton.MouseButton1Click:connect(function()
    Game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
    if (pointsToAward > 0) then
        PointsService:AwardPoints(player.userId, 1000)
    end
end)
0
Lol well your checking method for if theres enough points is gonna be way off.. 'if theres more points than 0 then award them a thousand'. Might just wanna change that. But yes, this should work. Goulstem 8144 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

It looks like it should. This site needs to allow side-scrolling for scripts though, as yours runs over the allowed size...

1
OMG are you that guy who does youtube vids D: :D NinjoOnline 1146 — 10y
0
Yes...Yes I am... :P NoahWillCode 370 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

I'm not sure, but change line 8 to ~~~~~~~~~~~~~~~~~ if (pointsToAward <1000) then ~~~~~~~~~~~~~~~~~

Answer this question