#I am trying to make the side devp like +1 jump everysec so when they buy it they get +100 jump
16 messages · Page 1 of 1 (latest)
Ah okay
First send your code either in a picture or with this format
So for this dev product to work
Let’s see what’s wrong with it
Ideally you wanna handle it the way roblox shows
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local productFunctions = {}
-- ProductId 123123 brings the user back to full health
productFunctions[123123] = function(receipt, player)
if player.Character and player.Character:FindFirstChild("Humanoid") then
player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth
-- Indicate a successful purchase
return true
end
end
-- ProductId 456456 awards 100 gold to the user
productFunctions[456456] = function(receipt, player)
local stats = player:FindFirstChild("leaderstats")
local gold = stats and stats:FindFirstChild("Gold")
if gold then
gold.Value += 100
return true
end
end
local function processReceipt(receiptInfo)
local userId = receiptInfo.PlayerId
local productId = receiptInfo.ProductId
local player = Players:GetPlayerByUserId(userId)
if player then
-- Get the handler function associated with the developer product ID and attempt to run it
local handler = productFunctions[productId]
local success, result = pcall(handler, receiptInfo, player)
if success then
-- The user has received their benefits!
-- return PurchaseGranted to confirm the transaction.
return Enum.ProductPurchaseDecision.PurchaseGranted
else
warn("Failed to process receipt:", receiptInfo, result)
end
end
-- the user's benefits couldn't be awarded.
-- return NotProcessedYet to try again next time the user joins.
return Enum.ProductPurchaseDecision.NotProcessedYet
end
-- Set the callback; this can only be done once by one script on the server!
MarketplaceService.ProcessReceipt = processReceipt
You can find more here
You can pretty much just copy and paste this script
And change the productID
And put the function that adds the 100 jump power
As for it not showing up… there doesn’t seem to be an issue on the server side
Just make sure you’re doing this alright
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local productId = 0000000 -- Change this to your developer product ID
-- Function to prompt purchase of the developer product
local function promptPurchase()
MarketplaceService:PromptProductPurchase(player, productId)
end
That should basically be it
** You are now Level 4! **