Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

TextBox is not being read?

Asked by 10 years ago

When the user types in a sentence/command I setup a way for it to be read by the script, but it does not work, I don't get any errors. I have a function that changes returnPressed.

local tempInputBin = "empty" -- to hold the input from the player temporarily
returnPressed = false

function readInput(linePath)
    while running == true do
    if readInput == (">")then
        wait(1)
    else
    local text = linePath
    tempInputBin = text.Text
    print(tempInputBin)
    running = false
    end
    end
end

function checkInput(inputOne,inputTwo,inputThree,funcOne,funcTwo,funcThree) -- checks up to three different answers then runs a function

if tempInputBin == inputOne then
    print("function one selected")
    funcOne()
elseif tempInputBin == inputTwo then
    print("function two selected")
    funcTwo()
elseif tempInputBin == inputThree then
    print("function three selected")
    funcThree()
    else print("invalid code entered")-- change to print on the cmd
end
end

if returnPressed == true then
    readInput(script.Parent.signInHelp)
    checkInput("help","sign in","debug",help(),signIn())

Answer this question