|
| 19 Dec 2013 07:14 PM |
script.Parent.Text = "SALES: "..(Game:GetService('MarketplaceService'):GetProductInfo(34762561).Sales) function onclick() local player = script.Parent.Parent.Parent.Parent.Parent.userId Game:GetService("MarketplaceService"):PromptPurchase(player, 34762561, IsPurchased) if isPurchased == true then script.Parent.Text = "SALES: "..(Game:GetService('MarketplaceService'):GetProductInfo(34762561).Sales) else script.Parent.Text = "SALES: "..(Game:GetService('MarketplaceService'):GetProductInfo(93125465).Sales) end end script.Parent.MouseButton1Click:connect(onclick) |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2013 07:16 PM |
| btw the script is in a button inside a surface gui inside a brick inside workspace |
|
|
| Report Abuse |
|
|
Quorum
|
  |
| Joined: 25 Oct 2013 |
| Total Posts: 4680 |
|
|
| 19 Dec 2013 07:31 PM |
| As I said on your other thread, you cannot get the player who used any aspect of the SurfaceGui, unless it's in their PlayerGui, in which case you can just parent up to their player, or if you're using a 'LocalScript' you can simply do 'game.Players.LocalPlayer'. |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2013 07:48 PM |
| i have no idea about how to do that lol, i've dealt with adornees before but idk how to now |
|
|
| Report Abuse |
|
|
Quorum
|
  |
| Joined: 25 Oct 2013 |
| Total Posts: 4680 |
|
|
| 19 Dec 2013 08:08 PM |
Put the SurfaceGui into 'StarterGui'. You'll need to rework some of the parenting, etc.
local MarketPlace = game:GetService("MarketplaceService") local ID = 34762561 local Player = game.Players.LocalPlayer
script.Parent.Parent.Adornee = Workspace.Whatever.Whatever script.Parent.Text = "Sales: "..MarketPlace:GetProductInfo(ID).Sales
script.Parent.MouseButton1Down:connect(function() MarketPlace:PromptPurchase(Player, ID) --// The third argument is used for gears. script.Parent.Text = "Sales: "..MarketPlace:GetProductInfo(ID).Sales --// Might aswell just update it each time. end)
|
|
|
| Report Abuse |
|
|
|
| 19 Dec 2013 08:23 PM |
| Thanks, I fixed the parents and it worked :) |
|
|
| Report Abuse |
|
|