|
It is suppose to give the player the gear inside server storage when they buy the dev product
-- setup local variables
local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = filterednumber
local nutritionbar = game.ServerStorage.NutritionBar
game.Players.PlayerAdded:connect(function()
print("start")
local DeveloperProducts = game:GetService("MarketplaceService"):GetDeveloperProductsAsync():GetCurrentPage()
for _, DevProductContainer in pairs(DeveloperProducts) do
for Field, Value in pairs(DevProductContainer) do
print(Field .. ": " .. Value)
end
print(" ")
end
print("end")
end)
-- define function that will be called when purchase finished
MarketplaceService.ProcessReceipt = function(receiptInfo)
-- find the player based on the PlayerId in receiptInfo
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
-- check which product was purchased
if receiptInfo.ProductId == productId then
-- handle purchase
local boughtbar = nutritionbar:Clone()
boughtbar = player.Backpack
-- more feedback for the player.
end
end
end
-- record the transaction in a Data Store
local playerProductKey = "p_" .. receiptInfo.PlayerId .. "_p_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)
-- tell ROBLOX that we have successfully handled the transaction
return Enum.ProductPurchaseDecision.PurchaseGranted
end
|
|
|
its done in a server script btw
the local script is popping up of the dev product
|
|
twinqleJoin Date: 2016-11-23 Post Count: 1613 |
i have not studied ######### receipts yet you've been twinqled |
|
|
twinqleJoin Date: 2016-11-23 Post Count: 1613 |
in other words i cant help
so my post was irrelevant
you've been twinqled |
|
|
dqxsJoin Date: 2013-12-08 Post Count: 696 |
Why don't you make it simplier?
|
|
nixpcJoin Date: 2012-02-05 Post Count: 15425 |
"local nutritionbar = game.ServerStorage.NutritionBar"
Another ROBLOX Gym clone? |
|
|
nixpcJoin Date: 2012-02-05 Post Count: 15425 |
What then? |
|
|
|
|
|
Clone it into startergear
|
|
twinqleJoin Date: 2016-11-23 Post Count: 1613 |
oh i know the problem it is beacuz you disd not sadelete the sscript.
you've been twinqled |
|
|
explode I dont want them to keep it tho when they reset
|
|
|
|
|
local boughtbar = nutritionbar:Clone()
boughtbar.Parent = player.Backpack
You were setting boughtbar to the players backpack, not setting the parent of boughtbar to the backpack |
|
|