Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 16 Apr 2015 07:52 PM |
Why isn't this working..?
local players = game.Players:GetChildren()
local buyButton = script.Parent local productId = 23429504
buyButton.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId) if game:GetSerivce(game.Players.LocalPlayer, productId) then for _,pl in pairs(players) do pl.Cash.Value = pl.Cash.Value + 10 end end end) If I check the output window it says "Studio API access is not enabled. Enable it by going to the game settings page." |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
| |
|
FauxHawke
|
  |
| Joined: 08 Jun 2012 |
| Total Posts: 2190 |
|
|
| 16 Apr 2015 07:58 PM |
Well first of all if game:GetSerivce(game.Players.LocalPlayer, productId) then
should be if game:GetService(game.Players.LocalPlayer, productId) then
And second of al you need to configure the game on the website to make it able to access dev products from studio.
Never trust atoms, they make up everything.™ |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 16 Apr 2015 08:00 PM |
Faux, i lol at u
if game:GetService(game.Players.LocalPlayer, productId) then
Look at the service he is trying to get |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 16 Apr 2015 08:00 PM |
| I've never had to let it access it from the website.. but how do I do that.. |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 16 Apr 2015 08:01 PM |
| I know my service is probably wrong.. what should it be? |
|
|
| Report Abuse |
|
|
FauxHawke
|
  |
| Joined: 08 Jun 2012 |
| Total Posts: 2190 |
|
|
| 16 Apr 2015 08:02 PM |
Didn't even catch that! I feel dumb now.
Never trust atoms, they make up everything.™ |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 16 Apr 2015 08:03 PM |
What service should it be?
and how can I allow dev products in-game? |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
| |
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 16 Apr 2015 08:09 PM |
Hopefully this is correct now, but it still says that "Studio API" needs to be enabled
local players = game.Players:GetChildren() local service = game:GetService("MarketplaceService")
local buyButton = script.Parent local productId = 23429504
buyButton.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId) if service:PlayerOwnsAsset(game.Players.LocalPlayer, productId) then for _,pl in pairs(players) do pl.Cash.Value = pl.Cash.Value + 10 end end end)
|
|
|
| Report Abuse |
|
|
FauxHawke
|
  |
| Joined: 08 Jun 2012 |
| Total Posts: 2190 |
|
|
| 16 Apr 2015 08:11 PM |
local players = game.Players:GetChildren() local buyButton = script.Parent local productId = 23429504
buyButton.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId) game:GetService("MarketPlaceService").PromptPurchaseFinished:connect(function(game.Players.LocalPlayer,product,true) for _,pl in pairs(players) do pl.Cash.Value = pl.Cash.Value + 10 end end) I wrote this fast so it might not work.
Never trust atoms, they make up everything.™ |
|
|
| Report Abuse |
|
|
FauxHawke
|
  |
| Joined: 08 Jun 2012 |
| Total Posts: 2190 |
|
|
| 16 Apr 2015 08:13 PM |
Your code is better then mine :P Now all you need to do is enable studio API access by going to the place your writing this script in on the website, and click on the "..." and then "Configure this game"
Never trust atoms, they make up everything.™ |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 16 Apr 2015 08:14 PM |
There is an error on your script @faux
"(function(game.Players"
the period says "Expected'('(to close '(' at column 78), got '.' |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 16 Apr 2015 08:15 PM |
| I joined ROBLOX in 2011, and yet have never seen "Studio API" before... yet I have made like 100 games.. |
|
|
| Report Abuse |
|
|
FauxHawke
|
  |
| Joined: 08 Jun 2012 |
| Total Posts: 2190 |
|
|
| 16 Apr 2015 08:16 PM |
local players = game.Players:GetChildren() local buyButton = script.Parent local productId = 23429504 local player = game.Players.LocalPlayer buyButton.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId) game:GetService("MarketPlaceService").PromptPurchaseFinished:connect(function(player,product,true) for _,pl in pairs(players) do pl.Cash.Value = pl.Cash.Value + 10 end end)
Never trust atoms, they make up everything.™ |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 16 Apr 2015 08:18 PM |
| I've got the script now, still don't see Studio API. |
|
|
| Report Abuse |
|
|
FauxHawke
|
  |
| Joined: 08 Jun 2012 |
| Total Posts: 2190 |
|
|
| 16 Apr 2015 08:20 PM |
1) Make sure the place you are editing is PUBLISHED on the roblox website 2) Go to the game's page, click on the "..." above and to the right of the title, and click "Configure this game" 3) Make sure the "Enable Studio Access to API Services: " box is checked. 4) Save.
Never trust atoms, they make up everything.™ |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
| |
|