0

# i have a problem with my verify script?

Edited 1 day ago

so basically im trying to do that when you click a button and the text in a textbox says 13 then something appears

script:

script.Parent.MouseButton1Down:Connect(function()
if script.Parent.Parent.TextBox.Text = "13" then
game.Workspace.Maxwellforbooks.maxwell.Transparency = 0
game.Workspace.Maxwellforbooks.forgor.Transparency = 0.02
end
end)



i also tryied to put == in line 2 but this didnt worked

it also cannot be a problem with the type of scripts because the local and the normal script didnt worked

0
there's nothing wrong except line 2, line 2 should have two equal signs T3_MasterGamer 2127 — 1d
0
if that didn't work, you probably did something wrong other than this script T3_MasterGamer 2127 — 1d
0
sorry if you got spam notifications, the site crashed for 2 seconds and it made my comment repeat 10 times T3_MasterGamer 2127 — 1d
0
as i said == dont work guardian_stone 12 — 1d
0
then your text is != 13 xXLegendGamerz16Xx 231 — 1d

0

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:

local pattern = "^%d+\$"

script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Parent.TextBox.Text:match(pattern) and script.Parent.Parent.TextBox.Text == "13" then -- make sure the text has no spaces and is only numbers from start to end
game.Workspace.Maxwellforbooks.maxwell.Transparency = 0
game.Workspace.Maxwellforbooks.forgor.Transparency = 0.02
else
script.Parent.Parent.TextBox.Text = "Invalid number"
end
end)


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)

-1

I think that you need to change:

script.Parent.MouseButton1Down:Connect(function()


to:

script.Parent.MouseButton1Click:Connect(function()


Hope it works :)

0
That's literally almost the same thing, MouseButton1Click is the combination of MouseButton1Down and MouseButton1Up T3_MasterGamer 2127 — 1d
0
Oh sorry, I tested the code and I don't know if you forgot to put 13 on the textbox when you're playing the game... don't you? Hgamerpro50 0 — 1d
0
no actually you need to type 13 in the text box and after that it makes it appear guardian_stone 12 — 1d
0
Don't tell that you're clicking the button an then putting 13 on the text box.... Hgamerpro50 0 — 1d