Are you running this on a server script or a local script?
If on server, it won't work, because client doesn't replicate on server, meaning that the TextBox.Text variable is always nil for server.
If this is the problem, put the code in a local script.
Otherwise, if you want the player to only write numbers in the TextBox, here's the script:
01 | local pattern = "^%d+$" |
03 | script.Parent.MouseButton 1 Click:Connect( function () |
04 | if script.Parent.Parent.TextBox.Text:match(pattern) and script.Parent.Parent.TextBox.Text = = "13" then |
05 | game.Workspace.Maxwellforbooks.maxwell.Transparency = 0 |
06 | game.Workspace.Maxwellforbooks.forgor.Transparency = 0.02 |
08 | script.Parent.Parent.TextBox.Text = "Invalid number" |
Also, to make sure your script has no errors, check the output.
You can use the script I provided above, it works for me. (make sure Maxwell the cat is completely invisible otherwise it will just be visible before you write 13)