It’s giving you that warning because the Text property of the Textbox is likely empty or is not a string, and it’s trying to find an asset with no id
You could listen for when the Text property changes, but I think a better approach would be to change the face when a button is pressed.
Also rbxassetid:// shouldn’t be in this case as it doesn’t convert the given Decal ID into an Image ID, which is what the Image property requires
As a basic example, let’s assume you’re trying to make it so it changes the face when a button is pressed, you can do this
local image = script.Parent.AvatarPreview.Head.Image
local textbox = script.Parent.ChangeFace
local button = --Location of button
button.MouseButton1Down:Connect(function()
local id = tonumber(textbox.Text)
if not id then
return
end
image.Image = "rbxthumb://type=Asset&id="..id.."&w=150&h=150"
end)
The textbox’s use is to store the ID of the image the user writes into it so when the button is pressed, it checks the Text of the textbox to get the id to put as the Image
When the specified button is pressed, it gets the Text of the given Textbox and converts it to a number via tonumber. This will return 1 of 2 things, the given text as a number, or nil if what was given was not a full number
Which is why the if not id then if statement is there, so it checks for nil, but if the text was properly converted, it’ll change the Image using a special url that helps in converting an id into an id suitable for properties that require an image ID