I want to make players able to change a script in-game via an GUI (TextBox). When they write an number (an ID of a product) in the GUI and press enter, I want to make that the “ID OF THE PRODUCT” get replaced with the number the player writes in the GUI.

THE SCRIPT:
local assetid = “ID OF THE PRODUCT”

local cd = script.Parent.ClickDetector

cd.MouseClick:connect(function(player)

game:GetService(“MarketplaceService”):PromptPurchase(player,assetid)

end)


Please help…

8 comments

0

Use a variable that gets whatever was entered into the box, and then set that variable as the ID of the product. Pretty simple.

0

How do I do that? XD

0

There is a "Text" property of every TextBox, which stores whatever the player has typed.

0

.. i think my question got deleted ................

0

i mean answer

0

oh.. this is a replicate question... well moderation voted ;P

0

welp