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: can someone fix this?

Previous Thread :: Next Thread 
SKITZzOG15 is not online. SKITZzOG15
Joined: 29 Dec 2010
Total Posts: 1242
07 Aug 2014 11:23 AM
local element = script.Parent
local id = 161562960
player=script.Parent.Parent.Parent.Parent --how many parents are needed

element.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(player,id)
wait(1)
if purchased then
i = game.Lighting.RAIN:Clone()
i.Parent = game.Workspace
end
end)
Report Abuse
DaMrNelson is not online. DaMrNelson
Joined: 27 Jul 2009
Total Posts: 4405
07 Aug 2014 11:25 AM
Is there any output? Is that the entire script? How is this "purchased" variable being set?

Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson
Report Abuse
NetsFan0 is not online. NetsFan0
Joined: 17 Apr 2009
Total Posts: 2777
07 Aug 2014 11:25 AM
local element = script.Parent
local id = 161562960
player=script.Parent.Parent.Parent.Parent --how many parents are needed

script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player,id)
wait(1)
if purchased then
i = game.Lighting.RAIN:Clone()
i.Parent = game.Workspace
end
end)
Report Abuse
Bobobob12 is not online. Bobobob12
Joined: 23 Jan 2008
Total Posts: 5350
07 Aug 2014 11:25 AM
if its in a screen gui, just remove 1 parent from the end
Report Abuse
NetsFan0 is not online. NetsFan0
Joined: 17 Apr 2009
Total Posts: 2777
07 Aug 2014 11:26 AM
If you are selling anything other then a dev product use PromtPurchase rather than PromptProductPurchase.
Report Abuse
NetsFan0 is not online. NetsFan0
Joined: 17 Apr 2009
Total Posts: 2777
07 Aug 2014 11:26 AM
And I can tell from the ID this is an Admin Game Pass.
Report Abuse
DaMrNelson is not online. DaMrNelson
Joined: 27 Jul 2009
Total Posts: 4405
07 Aug 2014 11:27 AM
@NetsFan0
You changed nothing with your script, other than replacing script.Parent with the variable for script.Parent...

Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson
Report Abuse
NetsFan0 is not online. NetsFan0
Joined: 17 Apr 2009
Total Posts: 2777
07 Aug 2014 11:29 AM
I changed PromptProductPurchase to PromptPurchase because he is selling a gamepass not a dev product.
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
07 Aug 2014 11:36 AM
local element = script.Parent
local id = 161562960
player=script.Parent.Parent.Parent.Parent --how many parents are needed
--probably something g\wrong with that ^
element.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(player,id)
wait(1)
--if purchased then-- purchased is nil, so never
i = game.Lighting.RAIN:Clone()
i.Parent = game.Workspace
--end
end)
Report Abuse
DaMrNelson is not online. DaMrNelson
Joined: 27 Jul 2009
Total Posts: 4405
07 Aug 2014 11:37 AM
@NetsFan0
Oops sorry, I never noticed that. Many apologies.

Anyways, am I the only one who cares that the "purchased" variable is popping up out of nowhere?

Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson
Report Abuse
DaMrNelson is not online. DaMrNelson
Joined: 27 Jul 2009
Total Posts: 4405
07 Aug 2014 11:37 AM
@Myself
Got ninja'd, Kevin did.

Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson
Report Abuse
NetsFan0 is not online. NetsFan0
Joined: 17 Apr 2009
Total Posts: 2777
07 Aug 2014 11:39 AM
Oh yeah, just saw the random "if purchased"
Report Abuse
VisualGraphics is not online. VisualGraphics
Joined: 26 Nov 2010
Total Posts: 6515
07 Aug 2014 11:48 AM
local element = script.Parent
local id = 161562960
local player = game.Players.LocalPlayer

element.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player, id, isPurchased)
wait(1)
if isPurchased then
local i = game.Lighting.RAIN:Clone().Parent == game.Workspace
end
end)
--localscript in startergui
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