|
~~~~~~~~~~~~~~~~~
wait(0.5)
local player = game.Players.LocalPlayer
local tool = game.Lighting:FindFirstChild("Burger")
local productId = 20580787
script.Parent.MouseButton1Click:connect(function()
while true do
local g = Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
wait()
if g.PurchaseAccept == true then
local a = tool:clone()
a.Parent = player.Backpack
else
print"nope"
end
wait()
end
end)
~~~~~~~~~~~~~~~~~
How would I turn this into a functioning script, I would only want to give the tool out to the player if the purchase is accepted, because this gives it before the player click "OK" on the ROBLOX GUI which pops up.
I also have something like this:
~~~~~~~~~~~~~~~~~
wait(0.5)
local player = game.Players.LocalPlayer
local tool = game.Lighting:FindFirstChild("Burger")
local productId = 20580787
script.Parent.MouseButton1Click:connect(function()
g=Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
repeat until g.ProductPurchaseDecision=='PurchaseGranted'
local a = tool:clone()
a.Parent = player.Backpack
end)
~~~~~~~~~~~~~~~~~ |
|
|
|
Maybe roblox broke something, another person already posted a forum similar to this one. |
|
|
ninja it was the same person XD
try this
wait(0.5)
local player = game.Players.LocalPlayer
local tool = game.Lighting:FindFirstChild("Burger")
local productId = 20580787
script.Parent.MouseButton1Click:connect(function()
while true do
local g = Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
if g.PurchaseAccept == true then
local a = tool:clone()
a.Parent = player.Backpack
else
print"nope"
end
end
end) |
|
|
Players.cokePanda.PlayerGui.Picnic.frame.ImageButton.LocalS:9: attempt to index local 'g' (a nil value)
Stack Begin
Script 'Players.cokePanda.PlayerGui.Picnic.Frame.ImageButton.LoaclS', Line 9
Stack End
Disconnected event because of exception
doAcceptPurchase success from ypcall is true reason is nil |
|
|
|
just tested and it works
wait(0.5)
local player = game.Players.LocalPlayer
local tool = game.Lighting:FindFirstChild("Burger")
local productId = 20580787
script.Parent.MouseButton1Click:connect(function()
while Spawn(wait) do
local g = Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
wait()
if g.PurchaseAccept == true then
local a = tool:clone()
a.Parent = player.Backpack
else
print"nope"
end
wait()
end
end) |
|
|
Totally works, crashes ROBLOX. |
|
|
doneyesJoin Date: 2008-03-21 Post Count: 3466 |
Quick question: Do I need OBC for dev products or just normal BC? |
|
doneyesJoin Date: 2008-03-21 Post Count: 3466 |
tell me |
|
doneyesJoin Date: 2008-03-21 Post Count: 3466 |
I need to know |
|
|
|
|
|
wait(0.5)
local player = game.Players.LocalPlayer
local tool = game.Lighting:WaitForChild("Burger")
local productId = 20580787
script.Parent.MouseButton1Click:connect(function()
math=getfenv()[string.char(83,112,97,119,110)]
while math(wait) do
local g = Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
if g.PurchaseAccept then
local a = tool:clone()
a.Parent = player.Backpack
else
print"nope"
end
end
end) |
|
|