Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

 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)

1 comment

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.

2 answers

✓ Accepted answer

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

2 comments

1

OMG are you that guy who does youtube vids D: :D

0

Yes...Yes I am... :P

I'm not sure, but change line 8 to

if (pointsToAward <1000) then 

This discussion is preserved as it was. New answers, comments, and votes are closed.