so im making a game and when i change textbox the script still uses old text for example the default text for textbox is 0 and i change it to any other number it will still think that textbox text is 0
script:
local MarketplaceService = game:GetService("MarketplaceService")
script.Parent.TextButton.MouseButton1Click:Connect(function()
local ASSET_ID = tonumber(script.Parent.TextBox.Text)
local asset = MarketplaceService:GetProductInfo(ASSET_ID)
print(asset.Name .. " :: " .. asset.Description.. " :: ".. asset.Sales)
end)
The :GetProductInfo() must have a number in it for the ID.
Having tonnumber() is mandatory, as the Text always gives a string, even if it’s just a number.