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: Buying Game Pass In-Game Not Working

Previous Thread :: Next Thread 
LuckyAura is not online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
09 Jan 2014 06:25 PM
I'm using this code inside of a text button but it will not work. Any ideas?

local cleanSweepId = 131852568
script.Parent.MouseButton1Click:connect(function(player)
Game:GetService("MarketplaceService"):PromptPurchase(player, cleanSweepId)
end)

I found this in the Output window:
18:22:15.831 - MarketplaceService:PromptPurchase() player should be of type Player, but is of type nil
18:22:15.832 - Script 'Players.Player1.PlayerGui.MainGUI.Main.C6.BuyRex (Not Worki', Line 3
18:22:15.833 - stack end
18:22:15.833 - Disconnected event because of exception

Thank you!
Report Abuse
LuckyAura is not online. LuckyAura
Joined: 25 Jul 2009
Total Posts: 4444
09 Jan 2014 08:08 PM
Bump.
Report Abuse
SymbolumSicarius is not online. SymbolumSicarius
Joined: 23 Jun 2009
Total Posts: 2899
09 Jan 2014 08:09 PM
MouseButton1Click won't return the player.

In a local script:


local cleanSweepId = 131852568
player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function(button)
Game:GetService("MarketplaceService"):PromptPurchase(player, cleanSweepId)
end)
Report Abuse
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
09 Jan 2014 08:09 PM
script.Parent.MouseButton1Click:connect(function(player)--
This isnt a ClickDetector. No player argument is there so player = nil
Report Abuse
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
09 Jan 2014 08:10 PM
Nor does it return a button
Report Abuse
SymbolumSicarius is not online. SymbolumSicarius
Joined: 23 Jun 2009
Total Posts: 2899
09 Jan 2014 08:11 PM
^I know that.
Just named it by habit.
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