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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 16 Jul 2017 05:58 PM |
If you are using a localscript then you access
local player = game.Players.LocalPlayer |
|
|
| Report Abuse |
|
|
Vazim
|
  |
| Joined: 26 Oct 2013 |
| Total Posts: 1805 |
|
|
| 16 Jul 2017 06:01 PM |
Sigh, I'm oblivious. Gracious.
|
|
|
| Report Abuse |
|
|