Fendd
|
  |
| Joined: 24 Apr 2013 |
| Total Posts: 10584 |
|
|
| 08 Dec 2016 10:47 PM |
[CONT.] they get the tool they requested INSTANTLY?
As in, when they buy it from my GUI I created, they do not have to rejoin to get the requested tool. Such thing can be found in Shake Shack when buying it from their SurfaceGUI shop, so I'm assuming it is possible.
Any help would be greatly appreciated, thanks.
Fendd || Graphic Designer || Current RAP:151,779 |
|
|
| Report Abuse |
|
|
Fendd
|
  |
| Joined: 24 Apr 2013 |
| Total Posts: 10584 |
|
|
| 08 Dec 2016 10:51 PM |
I currently only have this is a seperate script.
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:wait() if game:GetService("GamePassService"):PlayerHasPass(player, 544768303) then game.Lighting:FindFirstChild("BloxyCola"):Clone().Parent = player.Backpack game.Lighting:FindFirstChild("BloxyCola"):Clone().Parent = player.StarterGear end end)
Fendd || Graphic Designer || Current RAP:151,779 |
|
|
| Report Abuse |
|
|
Fendd
|
  |
| Joined: 24 Apr 2013 |
| Total Posts: 10584 |
|
|
| 08 Dec 2016 10:52 PM |
local productId = 548882115 local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function() script.Parent:FindFirstChild("SelectionPopSound"):Play() game:GetService("MarketplaceService"):PromptPurchase(player, productId) end)
and that to prompt the purchase.
Fendd || Graphic Designer || Current RAP:151,779 |
|
|
| Report Abuse |
|
|
Fendd
|
  |
| Joined: 24 Apr 2013 |
| Total Posts: 10584 |
|
|
| 08 Dec 2016 10:54 PM |
[1]
Fendd || Graphic Designer || Current RAP:151,779 |
|
|
| Report Abuse |
|
|
Fendd
|
  |
| Joined: 24 Apr 2013 |
| Total Posts: 10584 |
|
|
| 08 Dec 2016 10:57 PM |
[2]
Fendd || Graphic Designer || Current RAP:151,779 |
|
|
| Report Abuse |
|
|
Fendd
|
  |
| Joined: 24 Apr 2013 |
| Total Posts: 10584 |
|
|
| 08 Dec 2016 11:02 PM |
[3]
I will pay if your solution works
Fendd || Graphic Designer || Current RAP:151,855 |
|
|
| Report Abuse |
|
|
Fendd
|
  |
| Joined: 24 Apr 2013 |
| Total Posts: 10584 |
|
|
| 08 Dec 2016 11:32 PM |
[4]
Fendd || Graphic Designer || Current RAP:151,741 |
|
|
| Report Abuse |
|
|
OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
|
| 08 Dec 2016 11:44 PM |
local MarketplaceService = game:GetService("MarketplaceService")
gamepass = 123
MarketplaceService.ProcessReceipt = function(receiptInfo) for i,v in pairs (game.Players:GetChildren()) do if v.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == gamepass then end end end return Enum.ProductPurchaseDecision.PurchaseGranted end
|
|
|
| Report Abuse |
|
|
OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
|
| 08 Dec 2016 11:45 PM |
Forgot to mention I'm not sure if this works for gamepasses
|
|
|
| Report Abuse |
|
|
Fendd
|
  |
| Joined: 24 Apr 2013 |
| Total Posts: 10584 |
|
|
| 08 Dec 2016 11:54 PM |
Nah, doesn't seem to work.
Although I'm not sure if I'm isnerting it correctly.
Will paste script in after
Fendd || Graphic Designer || Current RAP:152,059 |
|
|
| Report Abuse |
|
|
Fendd
|
  |
| Joined: 24 Apr 2013 |
| Total Posts: 10584 |
|
|
| 08 Dec 2016 11:59 PM |
local MarketplaceService = game:GetService("MarketplaceService")
gamepass = 544768303
script.Parent.MouseButton1Click:connect(function() script.Parent:FindFirstChild("SelectionPopSound"):Play() game:GetService("MarketplaceService"):PromptPurchase(game.Players.LocalPlayer, 544768303) end)
MarketplaceService.ProcessReceipt = function(receiptInfo) for i,v in pairs (game.Players:GetChildren()) do if v.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == gamepass then game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:wait() if game:GetService("GamePassService"):PlayerHasPass(player, 544768303) then game.Lighting:FindFirstChild("BloxyCola"):Clone().Parent = player.Backpack game.Lighting:FindFirstChild("BloxyCola"):Clone().Parent = player.StarterGear end end)
end end end return Enum.ProductPurchaseDecision.PurchaseGranted end
Fendd || Graphic Designer || Current RAP:152,081 |
|
|
| Report Abuse |
|
|
Fendd
|
  |
| Joined: 24 Apr 2013 |
| Total Posts: 10584 |
|
|
| 09 Dec 2016 12:00 AM |
It gets to the purchase part, the transaction is completed but the BLoxyCola doesn't go into my inventory.
I'm sure I've done something stupid, can anybody help?
Fendd || Graphic Designer || Current RAP:152,081 |
|
|
| Report Abuse |
|
|