cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 01 Mar 2014 06:41 PM |
I'm selling consumables (developer product) the gamepasses that can be bought several times. so I'm letting them buy money but the money rewarding part won't work. What's wrong? Please help before I get banned for "scamming"
--[[This script goes inside of a TextBox which should be inside of a ScreenGui]] productId = 19180605-- Replace 123123123 with the id of your developer product.
local MarketplaceService = Game:GetService("MarketplaceService") function UsernameFromID(ID) if type(ID) ~= "number" then return end local sets = game:service("InsertService"):GetUserSets(ID) for k, v in next, sets do if v.Name == "My Models" then return v.CreatorName end end end function giveRewards(player) game.Players.leaderstats.Money.Value = game.Players.player.leaderstats.Money.Value +1000 return Enum.ProductPurcaseDecision.PurchaseGranted end MarketplaceService.ProcessReceipt = function(receiptInfo) giveRewards(UsernameFromID(receiptInfo.PlayerId)) end script.Parent.MouseButton1Down:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(script.Parent.Parent.Parent.Parent, productId) end) |
|
|
| Report Abuse |
|
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
| |
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
| |
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 01 Mar 2014 08:07 PM |
Someone please.. the error is in here
function giveRewards(player) game.Players.leaderstats.Money.Value = game.Players.player.leaderstats.Money.Value +1000 return Enum.ProductPurcaseDecision.PurchaseGranted end
That is the only problem. How am I incorrectly doing. I need help please!! |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2014 08:10 PM |
function giveRewards(player) game.Players[(player)].leaderstats.Money.Value =game.Players[(player]).leaderstats.Money.Value +1000 return Enum.ProductPurcaseDecision.PurchaseGranted end |
|
|
| Report Abuse |
|
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 01 Mar 2014 08:12 PM |
omg thank you. I hope this works |
|
|
| Report Abuse |
|
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 01 Mar 2014 08:29 PM |
Thanks a lot! However it's giving way more it should so I tried putting a debounce on it, but it had no effect... any help?
--[[This script goes inside of a TextBox which should be inside of a ScreenGui]] productId = 19180605-- Replace 123123123 with the id of your developer product.
local MarketplaceService = Game:GetService("MarketplaceService") function UsernameFromID(ID) if type(ID) ~= "number" then return end local sets = game:service("InsertService"):GetUserSets(ID) for k, v in next, sets do if v.Name == "My Models" then return v.CreatorName end end end function giveRewards(player) game.Players[(player)].leaderstats.Money.Value = game.Players[(player)].leaderstats.Money.Value + 1000 return Enum.ProductPurcaseDecision.PurchaseGranted end
MarketplaceService.ProcessReceipt = function(receiptInfo) local a = 0 if a == 0 then a = 1 giveRewards(UsernameFromID(receiptInfo.PlayerId)) wait(10) a = 0 end end script.Parent.MouseButton1Down:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(script.Parent.Parent.Parent.Parent, productId) end) |
|
|
| Report Abuse |
|
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 01 Mar 2014 08:43 PM |
omg.. One problem after another |
|
|
| Report Abuse |
|
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
| |
|
|
| 01 Mar 2014 08:50 PM |
Lost me there.. How much more does it give? If its say 10000 instead of 1000 then,change it to 100 and it'll give 1000 |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2014 08:52 PM |
And the debounce should wrok BUT Define local a at the TOP of the script,b4 anything else Put the if a==0 inside the giverewards function |
|
|
| Report Abuse |
|
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 01 Mar 2014 08:53 PM |
Ok, and it goes anywhere from 50k-80k... It's super random.
But I'll try that thx |
|
|
| Report Abuse |
|
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 01 Mar 2014 08:56 PM |
AGGHHHHHHH STILL DOESNT WORK.
--[[This script goes inside of a TextBox which should be inside of a ScreenGui]] productId = 19180605-- Replace 123123123 with the id of your developer product. local a = 0 local MarketplaceService = Game:GetService("MarketplaceService") function UsernameFromID(ID) if type(ID) ~= "number" then return end local sets = game:service("InsertService"):GetUserSets(ID) for k, v in next, sets do if v.Name == "My Models" then return v.CreatorName end end end function giveRewards(player) if a == 0 then a = 1 game.Players[(player)].leaderstats.Money.Value = game.Players[(player)].leaderstats.Money.Value + 1000 wait(10) a = 0 end return Enum.ProductPurcaseDecision.PurchaseGranted end
MarketplaceService.ProcessReceipt = function(receiptInfo)
giveRewards(UsernameFromID(receiptInfo.PlayerId))
end script.Parent.MouseButton1Down:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(script.Parent.Parent.Parent.Parent, productId) end) |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2014 08:57 PM |
| You could store the PurchaseId in a table and if that purchaseid has already been granted their reward then don't give it to them again. |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2014 08:57 PM |
What's the prob now..???? Does it still give too much?? |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2014 08:58 PM |
@free He's using dev products |
|
|
| Report Abuse |
|
|
| |
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
| |
|
|
| 01 Mar 2014 09:04 PM |
| I just told you what you need to do. |
|
|
| Report Abuse |
|
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 01 Mar 2014 09:05 PM |
| Yea well I have no idea how to do that, and I already know it won't work because it's not a gamepass and it needs to be able to be purchased many times |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2014 09:05 PM |
-facedesk-
Why do I even try? |
|
|
| Report Abuse |
|
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 01 Mar 2014 09:09 PM |
Ohh yes, you're so superior and I'm soo stupid.
I'm not a master at Lua because I don't use it very often I'm a python, javascript, jquery, html, and css kinda guy. Lua doesn't fit on that schedule very well so don't act like you're so much better than me |
|
|
| Report Abuse |
|
|
| |
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 01 Mar 2014 09:12 PM |
-facedesk-
Why do I even try?
Just sounds rude. Sorry if I'm being a d--- it's just that this is REALLY frustrating me because I've been waiting to get my hands on dev products forever and now it's not working correctly and I'm extremely annoyed. |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2014 09:17 PM |
productId = 19180605-- Replace 123123123 with the id of your developer product. local MarketplaceService = Game:GetService("MarketplaceService")
function getUserById(id) for i,v in pairs(game.Players:GetPlayers()) do if v.userId == id then return v end end end
function giveRewards(player) player.leaderstats.Money.Value = player.leaderstats.Money.Value + 1000 return Enum.ProductPurcaseDecision.PurchaseGranted end
MarketplaceService.ProcessReceipt = function(receiptInfo) giveRewards(getUserById(receiptInfo.PlayerId)) end
script.Parent.MouseButton1Down:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(script.Parent.Parent.Parent.Parent, productId) end) |
|
|
| Report Abuse |
|
|