I need help with a script im making

Thanks so much for the reply!
Am I doing something wrong here? I enabled 3rd party sales and did exactly what you did but it doesnt seem to work? I have added everything perfectly but its not working? How do I fix it?
It is not working, did I do something wrong?
Is something missing?

Ho, ho, calm down my guy. Don’t be so worried, we’re all here to help you and make you better so you can extend your capabilities and help us later in our lives. Have you entered a correct id? You can use @lluckvy 's method to check if its a number, make sure you paste or write the code in the event.

local MPS = game:GetService('MarketPlaceService')

script.Parent.MouseButton1Click:Connect(function()
    local Input = script.Parent.Parent.Textbox.Text
    local NumberedString = tonumber(Input)
    if NumberedString and type(NumberedString) == 'number' then
        MPS:PromptPurchase(game.Players.LocalPlayer, NumberedString)
    end
end)

Can you show me a video of what is happening and show me the errors?

1 Like

You should tell him to use the command line and the output more, it will help him identify errors and stuff.

I can see the issue, let me explain.

chrome_XsADyVyW3H

Make sure it says script.Parent.Parent.Text

You just need to remove the .TextBox part

Let me fix it on my previous post so no one gets the same issue.

1 Like

When I enter an ID and press the button to get the purchase prompt it does nothing

try putting print statements before everything to check if everything is working.

I didn’t notice that, you have the eyes of an eagle, my guy.

1 Like

Thank you so much!
Like this?

Yes, you can use my method and @lluckvy 's method too.

It wont respond. Does it not work with hat ID’s?

It doesn’t, it only works with shirts, pants and T-shirts, you will need something more advanced for that.

No, the line should look like this;

local input =  script.Parent.Parent.Text

Then you are done.

local MarketplaceService = game:GetService('MarketplaceService')
local Player = game:GetService('Players').LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
    local textbox = script.Parent.Parent
    local number = tonumber(textbox.Text)
    if number then
        MarketplaceService:PromptPurchase(Player,number)
    end
end)
1 Like

What? I didnt even see it! How much do you even analyze, you’re literally better at analyzing than me.

There is an issue in your code.

chrome_cOs8x6XlMb

It should be script.Parent.Parent.Text

RobloxStudioBeta_KSnuWG8GO8

local textbox = script.Parent.Parent.Parent.Textbox

Man, I would’nt of done it with out your help along with @LeVadamE
Thanks guys I appriciate it!

he specified “text” at the prompt line, he should remove that so it can work with what you said.

No problem!

@MeltedSalami Make sure to check the answer as solution so other players know it is correct.

1 Like