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 » Scripting Helpers
Home Search
 

Re: Consumables

Previous Thread :: Next Thread 
cade2000 is not online. 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 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
01 Mar 2014 07:33 PM
Help
Report Abuse
cade2000 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
01 Mar 2014 07:49 PM
Bump
Report Abuse
cade2000 is not online. 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
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
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 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
01 Mar 2014 08:12 PM
omg thank you.
I hope this works
Report Abuse
cade2000 is not online. 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 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
01 Mar 2014 08:43 PM
omg..
One problem after another
Report Abuse
cade2000 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
01 Mar 2014 08:48 PM
aghh!!!!
PLEASE HELP
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
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
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
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 is not online. 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 is not online. 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
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
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
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
01 Mar 2014 08:57 PM
What's the prob now..????
Does it still give too much??
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
01 Mar 2014 08:58 PM
@free
He's using dev products
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
01 Mar 2014 09:00 PM
I'm aware of that...
Report Abuse
cade2000 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
01 Mar 2014 09:02 PM
Still gives way tooo much
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
01 Mar 2014 09:04 PM
I just told you what you need to do.
Report Abuse
cade2000 is not online. 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
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
01 Mar 2014 09:05 PM
-facedesk-

Why do I even try?
Report Abuse
cade2000 is not online. 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
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
01 Mar 2014 09:11 PM
I'm not.
Report Abuse
cade2000 is not online. 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
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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