generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: dev product problems :(

Previous Thread :: Next Thread 
skill24 is not online. skill24
Joined: 14 Jun 2009
Total Posts: 13608
16 Mar 2015 08:36 AM
Hey friends.

I finally got a dev product GUI script to work; you click the button, spend 10 tix, get 5 coins.

HOWEVER,

If you buy it once, your coins go up by 5.
The 2nd time you buy it, your coins increase by 10.
The 3rd time, they go up by 15.

Why are they stacking? D:
Report Abuse
IoIiderp is not online. IoIiderp
Joined: 05 Feb 2012
Total Posts: 8613
16 Mar 2015 08:39 AM
you need to save the ID and check or the ID is already bought
Report Abuse
skill24 is not online. skill24
Joined: 14 Jun 2009
Total Posts: 13608
16 Mar 2015 08:40 AM
I want them to be able to buy it again; why are they getting more than they should?
Report Abuse
IoIiderp is not online. IoIiderp
Joined: 05 Feb 2012
Total Posts: 8613
16 Mar 2015 08:48 AM
Because you din't save the purchaseID and checked or it was already purchased.
Report Abuse
skill24 is not online. skill24
Joined: 14 Jun 2009
Total Posts: 13608
16 Mar 2015 08:54 AM
Halp pls


\
\wait(5)

local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = 23028863

MarketplaceService.ProcessReceipt = function(receiptInfo)

for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then


if receiptInfo.ProductId == productId then

player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 5
wait(0.01)
end
end
end

local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)

return Enum.ProductPurchaseDecision.PurchaseGranted
end
Report Abuse
IoIiderp is not online. IoIiderp
Joined: 05 Feb 2012
Total Posts: 8613
16 Mar 2015 08:56 AM
product key probably to long and why a wait(5)?
Report Abuse
skill24 is not online. skill24
Joined: 14 Jun 2009
Total Posts: 13608
16 Mar 2015 08:58 AM
Without the wait 5 it doesnt work. With it, it works.

Who knows?!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image