LuckyAura
|
  |
| Joined: 25 Jul 2009 |
| Total Posts: 4444 |
|
|
| 09 Jan 2014 06:25 PM |
I'm using this code inside of a text button but it will not work. Any ideas?
local cleanSweepId = 131852568 script.Parent.MouseButton1Click:connect(function(player) Game:GetService("MarketplaceService"):PromptPurchase(player, cleanSweepId) end)
I found this in the Output window: 18:22:15.831 - MarketplaceService:PromptPurchase() player should be of type Player, but is of type nil 18:22:15.832 - Script 'Players.Player1.PlayerGui.MainGUI.Main.C6.BuyRex (Not Worki', Line 3 18:22:15.833 - stack end 18:22:15.833 - Disconnected event because of exception
Thank you! |
|
|
| Report Abuse |
|
|
LuckyAura
|
  |
| Joined: 25 Jul 2009 |
| Total Posts: 4444 |
|
| |
|
|
| 09 Jan 2014 08:09 PM |
MouseButton1Click won't return the player.
In a local script:
local cleanSweepId = 131852568 player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function(button) Game:GetService("MarketplaceService"):PromptPurchase(player, cleanSweepId) end) |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2014 08:09 PM |
script.Parent.MouseButton1Click:connect(function(player)-- This isnt a ClickDetector. No player argument is there so player = nil
|
|
|
| Report Abuse |
|
|
|
| 09 Jan 2014 08:10 PM |
| Nor does it return a button |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2014 08:11 PM |
^I know that. Just named it by habit. |
|
|
| Report Abuse |
|
|