youssef04
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 1745 |
|
|
| 19 May 2014 04:33 PM |
Ok, so I have 2 scripts. One is supposed to work a on a brick for a surface GUI, the other is a normal screen GUI, the normal GUI one doesn't work, but it's the same concept... Here is the script:
SCRIPT FOR BRICK local buyButton = game.Workspace.BuyButton.SurfaceGui.TextButton local productId = 19860147 buyButton.MouseButton1Click:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId) end)
SCRIPT FOR GUI: local buyButton = game.StarterGui.ScreenGui.TextButton local productId = 19860147 buyButton.MouseButton1Click:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId) end) |
|
|
| Report Abuse |
|
|
youssef04
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 1745 |
|
| |
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 20 May 2014 12:13 PM |
| or you i thought you know more than this xD |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
| |
|
youssef04
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 1745 |
|
|
| 20 May 2014 12:35 PM |
Hold on.. Does this need to be PlayerGui? |
|
|
| Report Abuse |
|
|
|
| 20 May 2014 12:39 PM |
Youssef, the script's not working because the path to buybutton is in StarterGui. StarterGui is a service that transfers it's children to the player's PlayerGui whenever they respawn.
So try putting that script on the button and replacing the buybutton path with "script.Parent". |
|
|
| Report Abuse |
|
|
youssef04
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 1745 |
|
| |
|