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: [?] PromptPurchase GUI

Previous Thread :: Next Thread 
Vazim is not online. Vazim
Joined: 26 Oct 2013
Total Posts: 1805
16 Jul 2017 05:45 PM
id = ######### script.Parent.MouseButton1Down:connect(function(player) ############################################################### end) Why doesn't this work? It keeps saying "Unable to cast value to object".
Report Abuse
Vazim is not online. Vazim
Joined: 26 Oct 2013
Total Posts: 1805
16 Jul 2017 05:46 PM
id = 8756...100..44

script.Parent.MouseButton1Down:connect(function(player)
game:GetService("MarketplaceService"):PromptPurchase(player,id)
end)

Why doesn't this work? It keeps saying "Unable to cast value to object".


Report Abuse
6l8 is not online. 6l8
Joined: 17 Jun 2014
Total Posts: 4055
16 Jul 2017 05:47 PM
MouseButton1Down doesn't give you any references to the player.


Report Abuse
Vazim is not online. Vazim
Joined: 26 Oct 2013
Total Posts: 1805
16 Jul 2017 05:55 PM
So how could I achieve this from clicking a GUI button?


Report Abuse
99XxXLuKaXxX99 is not online. 99XxXLuKaXxX99
Joined: 22 Jul 2012
Total Posts: 122
16 Jul 2017 05:58 PM
If you are using a localscript then you access

local player = game.Players.LocalPlayer
Report Abuse
Vazim is not online. Vazim
Joined: 26 Oct 2013
Total Posts: 1805
16 Jul 2017 06:01 PM
Sigh, I'm oblivious. Gracious.


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