I have the following script:
local buyButton = game.Workspace.Buttons.BuyButton.SurfaceGui.TextButton
local user = game.Players.LocalPlayer.userId
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.leaderstats.Diamonds.Value + 10
if pointsToAward > 0 then
PointsService:AwardPoints(user, 1)
end
end
It is in a LocalScript, and Player Points will not be awarded (I know why). I want to move this from a LocalScript to a normal Script. Can I leave LocalPlayer to how it is or do I still need to define him, if so, how?
Thanks, fahmisack123

1 comment
I don't understand how this got a downrate???