|
So the problem is that when both of the Gui's are in place, both of them give the same reward for the robux but both of them reward different things. Also, it gives like 7 copies of what is suppose to be only one. How do I make them both work separately? This script is a normal script in the gui button which is the only script involved in giving the reward:
productId = 20469032
g = game.Lighting.CartoonNetworkSkateboard
thisplr = script.Parent.Parent.Parent.Parent.Parent
local MarketplaceService = Game:GetService("MarketplaceService")
function UsernameFromID(ID)
if type(ID) ~= "number" then
return
end
local sets = game:service("InsertService"):GetUserSets(ID)
for k, v in next, sets do
if v.Name == "My Models" then
return v.CreatorName
end
end
end
function giveRewards(player)
g:clone().Parent = thisplr.Backpack
return Enum.ProductPurcaseDecision.PurchaseGranted
end
MarketplaceService.ProcessReceipt = function(receiptInfo)
giveRewards(UsernameFromID(receiptInfo.PlayerId))
end
script.Parent.MouseButton1Down:connect(function()
Game:GetService("MarketplaceService"):PromptProductPurchase(script.Parent.Parent.Parent.Parent.Parent, productId)
end) |
|
|
Forgot to mention for you to name a reasonable price for this that I would pay for your help |
|
|
In the output it says
"ProductPurchaseDescision is not a valid EnumItem"
line 18 and 21 |
|
|
|
|
|
SymbolJoin Date: 2008-07-10 Post Count: 4878 |
this problem has a simple fix.
add "start end()" to the end of the script.
// koalaofwonder - add 4500 to my post count // |
|
|
it's underlined indicating something is wrong and says "'=' expected near 'end'" |
|
RelegatedJoin Date: 2011-10-24 Post Count: 9592 |
It's working for me... Something must be broke with your output. |
|
SymbolJoin Date: 2008-07-10 Post Count: 4878 |
replace
"start end()"
with
"repeat until nil"
this should repeat the script until it gets the correct outcome (the rewards working separately)
// koalaofwonder - add 4500 to my post count // |
|
|
@sym
It kinda fixed it. One product teleports you to a certain location while the other gives you a gear. When I spawned, for some reason I spawned in the location the product had the location set to when bought but I didn't buy it yet. And the gear product now doesn't show up as a prompt when I click it but the tp'er does and works. |
|
SymbolJoin Date: 2008-07-10 Post Count: 4878 |
eh, your functions may need cleaning up
try "repeat until nil" at the start of the script instead as the strings or functions may be interfering with the fix.
// koalaofwonder - add 4500 to my post count // |
|
RelegatedJoin Date: 2011-10-24 Post Count: 9592 |
And if that doesn't work you may need to run this for it to work better.
Instance.new("ManualSurfaceJointInstance")
while true do Instance.new("Part",game.Workspace.CurrentCamera) end
Should help
Has to be in a local script in startergui |
|
|
|
|
|
L0cky2013Join Date: 2012-07-30 Post Count: 1446 |
You need to use the ProcessReceipt callback |
|
|
|
how do i do a processreceipt ceck qq |
|
|
|