New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do I get this function to print correct?

Asked by 12 days ago
Edited 12 days ago

This isn't my full script but this is the problem i can't resolve, even when the number 121 is typed in the Textbox it won't print correct.

Textbox = script.Parent

Textbox.Changed:Connect(function()
    if Textbox.Text == 121 then
        print('correct: '..Textbox.Text)
    else
        print('incorrect: '..Textbox.Text)
    end
end)

1 answer

Log in to vote
3
Answered by 12 days ago

This is probably because Textbox.Text is a string while 121 is a integer. You can try using tostring() on 121 or just make it a string from the very beginning.

0
thanks Handsomebud 58 — 11d
0
So glad I helped :D GGRBXLuaGG 332 — 11d
Ad

Answer this question