Could someone tell me what I have done wrong in this script?
If I use AssetId it works but with bundles not.
LocalScript(StarterPlayerScripts):
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local productID = 429 -- Change this to your developer product ID
-- Function to prompt purchase of the developer product
local function promptPurchase()
local player = Players.LocalPlayer
MarketplaceService:PromptBundlePurchase(player, productID)
end
I would like to know if it is a Roblox engine bug or am I doing it wrong
Oh! sorry i was wrong i thought it was the same as with developer products
LocalScript(StarterPlayerScripts):
-- Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local promptPurchaseEvent = ReplicatedStorage:WaitForChild("PromptPurchaseEvent") -- Wait until the RemoteEvent exists, since it is being created by the Server
-- Create a part on the client that triggers our promptPurchaseEvent clicked
local part = Instance.new("Part")
part.Parent = game.Workspace
local clickDetector = Instance.new("ClickDetector")
clickDetector.Parent = part
-- When the ClickDetector is clicked by the player, fire an event to the Server
clickDetector.MouseClick:Connect(function()
promptPurchaseEvent:FireServer(429) -- Pass in an ID
end)
Script(ServerScriptServicie):
-- Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MarketplaceService = game:GetService("MarketplaceService")
-- Setup RemoteEvent in ReplicatedStorage
local promptPurchaseEvent = Instance.new("RemoteEvent")
promptPurchaseEvent.Name = "PromptPurchaseEvent"
promptPurchaseEvent.Parent = ReplicatedStorage
-- Listen for the RemoteEvent to fire from a Client and then trigger the purchase prompt
promptPurchaseEvent.OnServerEvent:Connect(function(player, id)
MarketplaceService:PromptBundlePurchase(player, id)
end)
I already did it right, but this error appears, so it is an engine error.