So I was just making dev products for my tycoon and then after testing them 5 times, it only gave me the money 3 times. It’s a pretty old script aswell but I have no idea how to fix it. If keep the dev products in the game will i get banned?
No, don’t know why you’d get banned.
I wouldn’t recommend using any sort of tycoon kit, make one from scratch.
I mean when the player buys the product then there is a 50% chance that he/she wont get the purchased item.
Do you still need help? I had the same issue and I know a way you can fix this issue.
I think i fixed it. I tested 5 times and it worked 5/5. I’m still unsure tho
Post the issue and your fix so we can verify it for you
Wait, talk to me on discord. I can help you out.
I also am facing this issue, can I get help aswell?
Sorry, i can’t remember much about this. My friend helped me to fix it and if i remember atleast something then there was some sort of script in that tycoon kit that didn’t let the other script work? im pretty sure it was the DevProductHandler. try disabling it and maybe it will work.
It might be a Studio bug, but a script that I use for handling the developer products is this script which is inside the ServerScriptService
This always worked for me, especially in the Team Test session. Let me know if this works for you if the problem still occurs after a possible fix by your friend
function getPlayerFromId(id)
for i,v in pairs(game.Players:GetChildren()) do
if v.userId == id then
return v
end
end
return nil
end
MarketplaceService.ProcessReceipt = function(receiptInfo)
local productId = receiptInfo.ProductId
local playerId = receiptInfo.PlayerId
local player = getPlayerFromId(playerId)
if productId == YOUR_DEVPRODUCTID_HERE then
local cashmoney = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
if cashmoney then
cashmoney.Value = cashmoney.Value + AMOUNTOFCASH
print("AMOUNTOFCASHBought")
end
end
if productId == YOUR_DEVPRODUCTID_HERE then
local cashmoney = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
if cashmoney then
cashmoney.Value = cashmoney.Value + AMOUNTOFCASH
print("AMOUNTOFCASHBought")
end
end
if productId == YOUR_DEVPRODUCTID_HERE then
local cashmoney = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
if cashmoney then
cashmoney.Value = cashmoney.Value + AMOUNTOFCASH
print("AMOUNTOFCASHBought")
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
So when you removed the DevProductHandler in this image, everything worked out fine? What if there’s something important in that script?
Hi can you help me with this? I need help I have the same issue.