Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Prompt Purchase isn't working?

Asked by 4 years ago

both in studio and in game it says the same thing "This item is currently not for sale" i'm trying to sell clothing assets in game.

01-- Local Script in StarterPlayerScripts
02rs = game:GetService("ReplicatedStorage")
03player = game:GetService("Players").LocalPlayer
04mouse = player:GetMouse()
05remotes = rs.Remotes
06pp = remotes:WaitForChild("Prompt_Purchase")
07mouse.Button1Up:connect(function()
08    if mouse.Target.Name == "Purchase_Button" then
09        local property = mouse.Target.Parent.Parent.Figure:FindFirstChild(mouse.Target:FindFirstChildOfClass("StringValue").Name)[mouse.Target:FindFirstChildOfClass("StringValue").Name.."Template"]
10        local str = tostring(property)
11        local num = tonumber(str:match("%d+"))
12        pp:FireServer(num)
13    end
14end)
15 
View all 23 lines...
0
I Have the same problem CrownedFigure 45 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

The reason is roblox changed

1PromptPurchase

to this

1PromptGamePassPurchase

so try this:

01-- Local Script in StarterPlayerScripts
02rs = game:GetService("ReplicatedStorage")
03player = game:GetService("Players").LocalPlayer
04mouse = player:GetMouse()
05remotes = rs.Remotes
06pp = remotes:WaitForChild("Prompt_Purchase")
07mouse.Button1Up:connect(function()
08    if mouse.Target.Name == "Purchase_Button" then
09        local property = mouse.Target.Parent.Parent.Figure:FindFirstChild(mouse.Target:FindFirstChildOfClass("StringValue").Name)[mouse.Target:FindFirstChildOfClass("StringValue").Name.."Template"]
10        local str = tostring(property)
11        local num = tonumber(str:match("%d+"))
12        pp:FireServer(num)
13    end
14end)
15 
View all 23 lines...
0
i tried that and then a ton of errors pop up and one is CorePackages.Packages._Index.roblox_rodux.rodux.NoYield:26: CorePackages.Packages._Index.roblox_purchase-prompt.purchase-prompt.Localization.LocalizationService:146: provided item type nil must be a number, string, or ItemType enum Vetrodex 22 — 4y
0
Oh i'm not sure what it is for clothing FluffySheep46209 369 — 4y
Ad

Answer this question