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 » Scripters
Home Search
 

Re: Developer Product Cash Value help

Previous Thread :: Next Thread 
Vritix is not online. 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 is not online. Vritix
Joined: 01 Jan 2011
Total Posts: 2790
16 Apr 2015 07:56 PM
bump
Report Abuse
FauxHawke is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Vritix
Joined: 01 Jan 2011
Total Posts: 2790
16 Apr 2015 08:07 PM
bump2
Report Abuse
Vritix is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Vritix
Joined: 01 Jan 2011
Total Posts: 2790
16 Apr 2015 08:23 PM
Thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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