Why TextBox.Text not changing ShirtTemplate?

https://gyazo.com/42344af2bd20f315a1eb40c83e0d4980?token=9f618561568d02a3f501c8d5956be7d7

i cant undarstand why its not working or printing me any errors

It’s because you’re only changing the ShirtTemplate if the TextBox’s contents are equal to 1 or 2 or 3 and etc.

If you want to confirm if something is a number you should use type(), here is an example with your code:

script.Parent.MouseButton1Click:Connect(function()
    local textBox = script.Parent.Parent.TextBox
    if type(tonumber(textBox.Text)) == "number" then
        script.Parent.Parent.Parent.Shirt.ShirtTemplate = "rbxassetid://"..textBox.Text
    end
end

I hope this solves your issue! :+1:

2 Likes