#MarketplaceService

11 messages · Page 1 of 1 (latest)

hushed bane
#

The player types in an id number and once they leave the text box it updates a intvalue. when they interact with a proximity prompt the promptpurchase is supposed to pop up but there is an error that says: MarketplaceService:PromptPurchase() second argument is not a valid assetId (supplied assetId was less than 0).
The script that the players type their id number into is a local script in a gui, and the script that when they interact with the proximity promt is a regualr script. I can send pictures if they are needed and i will give more information, but i just need help

jolly dragon
#

It sounds like the issue may be related to how the asset ID is being passed to the PromptPurchase() function. It's possible that the ID is not being properly converted to an integer value before being passed to the function, which is causing the error.

Here are a few things you can try:

Make sure that the ID value is being properly converted to an integer. You can use the tonumber() function to do this, like so:

local assetId = tonumber(idTextBox.Text)

Check that the value of assetId is greater than 0 before passing it to the PromptPurchase() function. It's possible that the ID entered by the player is not a valid asset ID, and this could be causing the error.

Double-check that the PromptPurchase() function is being called with the correct number of arguments. According to the Roblox API documentation, the function takes two arguments: the asset ID and the player who is making the purchase. Make sure that you are passing both of these arguments correctly.

If none of these suggestions help, please provide more information about your code and how it is structured, as well as any relevant error messages or console output. This will help me better understand the issue and provide more targeted advice.

#

it will work 50/50

#

Because it has happend to me before

hushed bane
#

The id that i am entering is a gamepass from another game. when i enter the id into the text box i see it change on the IntValue thing but it still gives that error. the prompt purchase has the plr and the itemId is there too, unless im doing it wrong im pretty sure its right. and with the tonumber thing i have no idea how to do that or how it works

#

shuold i be using a different value type or something?

#

or do i have to change the value value in a regular script

#

or none

#

is there a way to make the server update and know that the value changed or does that happen automaticly

#

because the only thing that goes wrong is that the server thinks there is no value when i literaly see the value change when i put it in

#

im sick and tired of this i been trying to figure this out forever 😭