Hello so i am trying to make a system where people can buy things off the roblox catalog. I want the asset name of the product to load in, but it just does not. the script works when the string value 'asset' is definite. But i want to have a player be able to paste an itemid into a textbox then hit search. EDIT: I have now realized that this has to do with replication and i have changed the question
Script Inside of the text label
local MPS = game:GetService("MarketplaceService") local ID = script.Parent.Parent.Asset.Value local SB = script.Parent.Parent.Parent.SB local function getAssetName(assetID) assetID = tonumber(assetID) if not assetID then return nil end local assetName = MPS:GetProductInfo(assetID, 0) return assetName.Name end SB.MouseButton1Click:Connect(function() wait(1.5) script.Parent.Text = getAssetName(ID) or "Error" end)
if you can see i put a delay on the get asset name so there would be time for the value to update. But that didnt really work. And what happens is it goes to Error which is the or.
script inside of the Asset Value to update it to the textbox's input
local S = script.Parent.Parent.Parent.SB S.MouseButton1Click:Connect(function() script.Parent.Value = script.Parent.Parent.Parent.Input.Text end)
I really am not sure how to fix this. I feel that it is the script inside of asset value since it just feels crappy to me.