|
| 27 Oct 2014 11:51 AM |
Roblox broke a script I have in a GUI for buying credits.. anyone know what they did and how to fix it?
local plr = script.Parent.Parent.Parent.Parent.Parent local link = game:GetService("MarketplaceService") deb = 0
script.Parent.MouseButton1Click:connect(function() local marketId = 21256239 link:PromptProductPurchase(plr,marketId) link.ProcessReceipt = function(receiptInfo) if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then if deb == 0 then deb = 1 plr.leaderstats.Credits.Value = plr.leaderstats.Credits.Value + 20 wait(1) deb = 0 end end end end) |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 27 Oct 2014 12:01 PM |
I'm pretty sure you have to prompt product purchases on the client side...
Roblox didn't break it. It probably never worked. |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2014 12:42 PM |
| I'm loling to this message. |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2014 02:33 PM |
| It always worked before, but then around the time of the new particle effects I tested it and it didn't work. |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Oct 2014 05:48 PM |
| If theres no output put prints in the script and tell us what line the script stops at |
|
|
| Report Abuse |
|
|
| |
|
OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
| |
|
|
| 11 Nov 2014 01:31 AM |
This is the output when I try to click it:
07:28:56.411 - MarketplaceService:PromptProductPurchase() player should be of type Player, but is of type Players 07:28:56.412 - Script 'Players.Player.PlayerGui.Extra.50 Credits.Script', Line 8 07:28:56.413 - Stack End 07:28:56.413 - Disconnected event because of exception
and this is the line that Roblox lua debugger is saying is wrong:
link:PromptProductPurchase(plr,marketId) |
|
|
| Report Abuse |
|
|
| |
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 11 Nov 2014 05:09 PM |
local plr = script.Parent.Parent.Parent.Parent local link = game:GetService("MarketplaceService") deb = 0
script.Parent.MouseButton1Click:connect(function() local marketId = 21256239 link:PromptProductPurchase(plr,marketId) link.ProcessReceipt = function(receiptInfo) if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then if deb == 0 then deb = 1 plr.leaderstats.Credits.Value = plr.leaderstats.Credits.Value + 20 wait(1) deb = 0 end end end end) |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2014 05:11 PM |
| Of course they broke it. Roblox breaks everything. :D |
|
|
| Report Abuse |
|
|
|
| 13 Nov 2014 10:51 AM |
| @Icy that made the button not work even more. |
|
|
| Report Abuse |
|
|
|
| 13 Nov 2014 10:52 AM |
| Icy, in my opinion, is a huge troll. (And on special occasions, points out what methods need to be deprecated :D) |
|
|
| Report Abuse |
|
|
|
| 13 Nov 2014 11:31 AM |
"is a huge troll" Have you met anaiyze? |
|
|
| Report Abuse |
|
|
| |
|
anaIyze
|
  |
| Joined: 29 May 2014 |
| Total Posts: 2048 |
|
|
| 13 Nov 2014 12:31 PM |
kohl = (game . Players . LocalPlayer )
link = Game : FindService [[ MarketplaceService ]]
Kohl_enable_disable = 0
KohlItem = ("21256239")
script . Parent . mouseButton1Down : connect ( function ( ) link : PromptProductPurchase (.true && KohlItem); kohl. leaderstats. Credits. Value = ( kohl. leaderstats. Credits. Value + 20); end )
-- Profeshinal scripture :).
|
|
|
| Report Abuse |
|
|
| |
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 13 Nov 2014 01:07 PM |
Server sided scripts don't run in GuiInstances with filteringenabled, screenguis are omitted from the server, this might also be the case without filteringenabled, but I don't think so. Maybe this is the cause? Hook remotes to it. I didn't read the script, so be wary of other potential mistakes.
-=Robo=- |
|
|
| Report Abuse |
|
|