|
| 06 Jun 2014 03:00 PM |
Help me fix this script pls
local buyButton = script.Parent.Button.Button local productId = ID local Plr = script.Parent.Parent buyButton.MouseButton1Click:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(Plr, productId) end) local MarketplaceService = Game:GetService("MarketplaceService") MarketplaceService.PromptProductPurchaseFinished:connect(function(userId, productId, isPurchased) if isPurchased then --What happens after purchase end end) local buyButton2 = script.Parent.Button2.Button local productId2 = ID buyButton2.MouseButton1Click:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(Plr, productId2) end) MarketplaceService.PromptProductPurchaseFinished:connect(function(userId, productId2, isPurchased2) if isPurchased2 then --What happens after purchase end end) |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 03:04 PM |
| Im going put id after someone fixes it |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 06 Jun 2014 03:04 PM |
| What'd wrong with it you idiot |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 03:06 PM |
| I don't know how to make it so it gives 1 player point. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 03:09 PM |
-- declare service local PointsService = Game:GetService("PointsService") -- Bind function to player added event game.Players.PlayerAdded:connect(function(player) -- Get total number of points the game has available local pointsToAward = PointsService:GetAwardablePoints() -- Get total number of points this game has already awarded to the player local universeBalance = PointsService:GetGamePointBalance(player.userId) -- Check if the game has points to award and if the player hasn't gotten any points yet. -- If both are true, then give the player a point. if ( pointsToAward > 0 and universeBalance == 0) then -- pcall here, as AwardPoints *will throw an error* if another server has awarded the -- points that were available between us checking how many were available and -- us actually awarding the points. There is currently no way to avoid this pcall, -- whenever you AwardPoints you should always wrap it in a pcall. pcall(function() PointsService:AwardPoints(player.userId, 1) end) end end) -- Bind function to when points are successfully awarded PointsService.PointsAwarded:connect(function(userId, userBalanceinUni, userBalance) -- Show message indicating that a player has gotten points local message = Instance.new('Message', game.Workspace) message.Text = "Point awarded to " .. userId .. ". This player now has " .. userBalance .. " points total!" wait(5) message:Destroy() end)
look over it
the main line that gives you it is PointsService:AwardPoints(player.userId, 1) |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 06 Jun 2014 03:09 PM |
| prompted.Game:getservice("LeadersStats").PlayerPoints = prompted.Game:getservice("LeadersStats").PlayerPoints + 1 |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 03:11 PM |
| kev that will add a fake playerpoint value if the player has a leaderboard with "Payerpoint" as the name |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 03:12 PM |
| or I might have read that wrong |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 03:36 PM |
| do i put it between if isPurchased then? |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 03:43 PM |
| because im trying to do if isPurchased then give player point if available |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 03:47 PM |
is this how it works? if not right fix it pls local buyButton = script.Parent.Button.Button local productId = 20042710 local Plr = script.Parent.Parent
buyButton.MouseButton1Click:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(Plr, productId) end)
local MarketplaceService = Game:GetService("MarketplaceService")
MarketplaceService.PromptProductPurchaseFinished:connect(function(userId, productId, isPurchased) if isPurchased then PointsService:AwardPoints(player.userId, 1) --What happens after purchase end end)
local buyButton2 = script.Parent.Button2.Button local productId2 = ID
buyButton2.MouseButton1Click:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(Plr, productId2) end)
MarketplaceService.PromptProductPurchaseFinished:connect(function(userId, productId2, isPurchased2) if isPurchased2 then --What happens after purchase end end) |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 03:53 PM |
| Also can anyone tell me how to put in game that a certain purchase gives player point to player point total in game not to a player |
|
|
| Report Abuse |
|
|
| |
|
| |
|