04-26-2014 06:02 AM I asked weather this code it correct, reply was "user is undefined". I would like to change it to the player that clicked it. Here's part of the script:
local PointsService = Game:GetService("PointsService") PointsService:AwardPoints(user.userId, 1)
Here's the full script:
local buyButton = game.Workspace.BuyButton.SurfaceGui.TextButton buyButton.MouseButton1Click:connect(function() local productId = 19251902 Game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId) local PointsService = Game:GetService("PointsService") game.Players.LocalPlayer.leaderstats.Diamonds.Value = game.Players.LocalPlayer.leaderboard.Gold.Value + 25000 PointsService:AwardPoints(user.userId, 1) end)
I would greatly appreciate any fixes.
Also, I would like to request How to get the player when the GUI is clicked. For example: BOB clicks the GUI, I would like to know the code on how to get his character.
Thanks!
Already answered. Putting this so it isn't marked unanswered.