Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to get text box to write answer of GUI questions?

I am working on a game which works on finding some things and answering questions like Baldi basics roblox version..where you find books and solve math questions by writing right answers in text box..any way to do it?

2 comments

0

This is not a request site.

0

once they have entered the text, do if textbox.Text == your answer then

1 answer

When you press the Enter key it gets the text in the input and transforms it in a number. If it isn't the number, the answer is wrong. If it is a number, check if it is equal with the result. if it is, the answer is right. If it isn't, the answer is wrong. This is what I said in a ModuleScript:

local function CheckAnswer(input, answer)
    local printedAnswer = tonumber(input.Text)
    local rightAnswer = false    

    if printedAnswer and printedAnswer == answer then
        rightAnswer = true
    end

    return rightAnswer
end

return CheckAnswer

1 comment

0

If it dosent work, write "return CheckAnswer()" instead of "return CheckAnswer"

This discussion is preserved as it was. New answers, comments, and votes are closed.